Welcome! Log In Create A New Profile

Advanced

1.8.1 rewrite changes

Posted by vojtech.kurka 
1.8.1 rewrite changes
January 26, 2016 03:11PM
I don't know if this is the new "right" behaviour mentioned in the changelog, but our rewrites stopped working after the upgrade to 1.8.1

I have an URL:
"http://mysite.com/css/main-responsive.v203.css"
Which should point to the file:
"/home/mysite/www/css/main-responsive.css"

The config, that works on 1.8.0 and not on 1.8.1 (returns 404) is this:

server {

listen 80;

server_name mysite.cz;
root /home/mysite/www/;
expires 100d;

location ^~ / {
access_log off;

location /css/ {
alias /home/mysite/www/css/;

location ~ /(.*)\.v[0-9]+\.(css) {
add_header Cache-Control public;
try_files $uri $uri/ /$1.$2;
}

location /css/fonts/ {
add_header Access-Control-Allow-Origin *;
}
}

location /js/ {
alias /home/mysite/www/js/;

location ~ /(.*)\.v[0-9]+\.(js) {
add_header Cache-Control public;
try_files $uri $uri/ /$1.$2;
}
}

location ^~ /img/ {
..........
}

.......
}

Could you please tell me, how exactly did the rewriting change in the 1.8.1 release? Thank you
Re: 1.8.1 rewrite changes
January 28, 2016 11:49AM
Removing the aliases makes it working on 1.8.0 and 1.8.1. It doesn't make sense to use them when the root is already defined.
It's just strange to introduce such a change in a "stable" release, this was the first time when nginx update stopped our website.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready