Welcome! Log In Create A New Profile

Advanced

expire issues using proxy_pass

Posted by biazus 
expire issues using proxy_pass
August 30, 2013 04:07PM
Hi Everyone,

I've been facing a little situation using proxy_pass. As you can see at conf file bellow, there is a docroot filesystem where the static files are located, and a proxy_pass configuration for another path. It works fine, however when i configure the expires directives, i got 404 for the proxy_pass requests.

server
{

server_name foo;

root /nfs/staticfiles/;

#Here is the issue!
location /img/ {
proxy_pass http://foo.bar.com/;
}

# When i configure this directive, i got 404 for /img path
location ~* \.(png|jpg|jpeg|gif|ico)$ {
expires max;
}

location ~ /\.svn {
deny all;
}
}


Thank you!
Biazus
Re: expire issues using proxy_pass
September 02, 2013 10:31PM
Sorry Guys, my bad!

The correct directive for /img path is:

location ^~ /img/ {
proxy_pass http://foo.bar.com/;
break;
}

That way works as expected!

Best Regards,

Biazus
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 80
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready