location question
Igor Sysoev
is at rambler-co.ru
Thu Sep 3 17:31:21 MSD 2009
On Thu, Sep 03, 2009 at 03:14:44PM +0200, Tomasz Pajor wrote:
>
> >On Thu, Sep 03, 2009 at 01:59:52PM +0200, Tomasz Pajor wrote:
> >
> >
> >>For those who would want to use such a setup:
> >>
> >> location ~ ^/imgheaders/(.*)$ {
> >> root /vhosts/static/img/headers;
> >> try_files /$1 @headers;
> >> }
> >>
> >
> > location /imgheaders/ {
> > alias /vhosts/static/img/headers/;
> > try_files $uri @headers;
> > }
> >
> this doesn't work, maybe because i have one more location, this are all
> locations in that server space.
>
> location ^~ /imgheaders/ {
> alias /vhosts/static/img/headers;
> try_files $uri @headers;
> }
>
> location @headers {
> fastcgi_pass unix:/var/run/spawn-fcgi.sock;
> fastcgi_param SCRIPT_FILENAME /vhosts/test/ImageText.php;
> include fastcgi_params;
> }
>
> location ~* ^.+\.(js|ico|gif|jpg|png|css|swf|xml|xsl|flv|cur|mp3)$ {
> root /vhosts/static;
> access_log off;
> expires 30d;
> }
Yes, you need to disable regex for /imgheaders/ if you have also
"location ~* ^.+\.(js|ico|gif|jpg|png|...".
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx
mailing list