L
L
lnked2016-09-07 12:53:42
Nginx
lnked, 2016-09-07 12:53:42

How to configure nginx to ignore html files?

current config,

server {
    listen          80;
    index           index.html index.htm index.php;
    server_name     site.local www.site.loc;
    root            /var/www/site.loc/public_html;
    
    error_log       /var/www/site.loc/logs/error.log;
    access_log      /var/www/site.loc/logs/access.log main;

    location ~* \.(css|js|png|ico|jpe?g|gif|woff|eot|svg|ttf|txt)$ {
        expires 30d;
    }

    location / {
        rewrite ^(.*)$ /index.php;
        include   /usr/local/etc/nginx/conf.d/php-fpm;
    }
}

Tell me how to make sure that html files do not get into the location / { .. } section?
It is necessary that html files open, ignoring this section location / { .. }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lnked, 2016-09-07
@lnked

Understood, thank you all)
location ~* \.(htm|html)$ {}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question