# How to check which directive actually delivers the files?

**URL:** <https://www.ruby-forum.com/t/how-to-check-which-directive-actually-delivers-the-files/243928>\
**Category:** NGINX\
**Created:** [January 26, 2016, 1:10pm UTC](https://www.ruby-forum.com/t/how-to-check-which-directive-actually-delivers-the-files/243928 "2016-01-26T13:10:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [January 26, 2016, 1:10pm UTC](https://www.ruby-forum.com/t/how-to-check-which-directive-actually-delivers-the-files/243928/1 "2016-01-26T13:10:24Z")

</div>

Hi,

I’ve setup nginx + php-fpm for a typo3.

It looks like this:

server {  
listen 80;  
server\_name the\_server;  
access\_log /home/the\_server/logs/nginx\_access\_log mycustom;  
error\_log /home/the\_server/logs/nginx\_error\_log;  
root /home/the\_server/FTPROOT/htdocs ;  
index index.php;

```
    location = /favicon.ico {
             log_not_found off;
             access_log off;
    }

    location = /robots.txt {
             allow all;
             log_not_found off;
             access_log off;
    }

    # Deny all attempts to access hidden files such as .htaccess,

```

.htpasswd, .DS\_Store (Mac).  
location ~ /. {  
deny all;  
access\_log off;  
log\_not\_found off;  
}

```
 location ~ [^/]\.php(/|$) {
     include /usr/local/etc/nginx/fastcgi-includes.conf;
     fastcgi_param SCRIPT_FILENAME

```

$document\_root$fastcgi\_script\_name;  
if (!-f $document\_root$fastcgi\_script\_name) {  
return 404;  
}

```
   fastcgi_pass unix:/var/run/fastcgi/the_server.sock;
   fastcgi_index index.php;
   include fastcgi_params;

```

}  
client\_max\_body\_size 100M;

```
     location ~ /\.(js|css)$ {
             expires 604800s;
     }

     if (!-e $request_filename){
             rewrite ^/(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$

```

/$1.$3 last;  
}

```
     location ~* ^/fileadmin/(.*/)?_recycler_/ {
             deny all;
     }
     location ~* ^/fileadmin/templates/.*(\.txt|\.ts)$ {
             deny all;
     }
     location ~* ^/typo3conf/ext/[^/]+/Resources/Private/ {
             deny all;
     }
     location ~*

```

^/(typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon.ico) {  
}

```
     location / {
                     if ($query_string ~ ".+") {
                             return 405;
                     }
                     if ($http_cookie ~

```

‘nc\_staticfilecache|be\_typo\_user|fe\_typo\_user’ ) {  
return 405;  
} # pass POST requests to PHP  
if ($request\_method !~ ^(GET|HEAD)$ ) {  
return 405;  
}  
if ($http\_pragma = ‘no-cache’) {  
return 405;  
}  
if ($http\_cache\_control = ‘no-cache’) {  
return 405;  
}  
error\_page 405 = @nocache;

```
                     try_files

```

/typo3temp/tx\_ncstaticfilecache/${scheme}/$host${request\_uri}index.html  
@nocache;  
}

```
     location @nocache {
                     try_files $uri $uri/ /index.php$is_args$args;
     }

```

}

However, I’m not sure if nginx actually delivers the static file.  
The reason I’m not so sure is that I have varnish+nginx in front of this  
(on a different host) and varnish reports a “MISS” for what should be  
static deliveries from nginx.

I activated access-logging in the php-fpm pool and it looks like it’s  
actually not working as intended.

So, how can I see what it’s actually trying to do?

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 29, 2016, 12:40pm UTC](https://www.ruby-forum.com/t/how-to-check-which-directive-actually-delivers-the-files/243928/2 "2016-01-29T12:40:41Z")

</div>

To server static files from nginx use the below configs inside  
serverblock  
of nginx,

location ~\* .(js|css|png|jpg|jpeg|gif|ico|eot|otf|ttf|woff)$ {  
access\_log off; log\_not\_found off; expires 30d;  
}

and use symbol “|” without quote and extension name to add more static  
file  
or extension types.

Source:

> **[Install WordPress on NGINX with FastCGI Cache in Ubuntu](https://www.atulhost.com/install-wordpress-nginx-fastcgi-cache-ubuntu)**
>
> If you are running a WordPress blog or website on NGINX Webserver, then you should also enable FastCGI caching module, because FastCGI is not only better but also faster when we compare it with WP Super Cache and W3 Total Cache under heavy load. We...

Posted at Nginx Forum:

> **[Re: How to check which directive actually delivers the files?](https://forum.nginx.org/read.php?2,264129,264206#msg-264206)**
>
> Hi, I've setup nginx + php-fpm for a typo3. It looks like this: server { listen 80; server\_name the\_server; access\_log /home/the\_server/logs/nginx\_access\_log mycustom; error\_log /home/the\_server/logs/nginx\_erro
