Welcome! Log In Create A New Profile

Advanced

nginx proxy config problem

May 24, 2012 05:26AM
2 question:
1. i want to put the pic,css,js etc. files on the frontend server, but with below config, i put a tar file to /var/www/a.com/test.tar and visite http://a.com/test.tar it return a 404 herder. how can i fix it?

2. i want control the proxy cache for different cache time with the different request uri, could you give me the right way to config it ? thank you very much.

my nginx.conf

server {
listen 80;
root /var/www/a.com;
server_name a.com;
index index.html index.htm index.php;

location ^~ /admin/ {
proxy_pass http://backend;
}

location ~* ^/post/ {
proxy_cache main;
proxy_cache_valid 200 301 302 60d;
proxy_cache_valid any 30d;
proxy_pass http://backend;
}

location ~* ^/(list|archive)/ {
proxy_cache main;
proxy_cache_valid 200 301 302 60d;
proxy_cache_valid any 1d;
proxy_pass http://backend;
}

location ~ ^.*\.php$ {
proxy_pass http://backend;
}

location / {
proxy_cache main;
proxy_cache_valid any 10m;
proxy_pass http://backend;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$ {
expires 30d;
}

}
Subject Author Posted

nginx proxy config problem

21andy May 24, 2012 05:26AM

Re: nginx proxy config problem

Edho Arief May 24, 2012 05:36AM

Re: nginx proxy config problem

21andy May 24, 2012 06:02AM

Re: nginx proxy config problem

Valentin V. Bartenev May 24, 2012 07:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 173
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