nginx proxy config problem

Edho Arief edho at myconan.net
Thu May 24 09:35:17 UTC 2012


Hello

Am 24.05.2012 16:26 schrieb "21andy" <nginx-forum at nginx.us>:
>
> 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?
>

Your static file regex doesn't include .tar file.

> 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;
>    }
>
> }
>
> Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,226787,226787#msg-226787
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120524/56ce1e34/attachment.html>


More information about the nginx mailing list