I have a set of rewrite rules as
rewrite ^/(.*) /script.php?file=$1 last;
location ~ \.php$ {
php proxy
}
but I want to make a few exceptions as
location = file1|file2|file3 {
static delivery
}
but rewrite will change any static file to php file before the latter
location.
I cannot use rewrit
In a server as
server {
server_name domain.com *.domain.com
root /var/www/$server_name;
}
is it possible to set locations for subdomains based on subfolders of the
$server_name ?
location matching sub1.domain.com {
serving from /var/www/$server_name/sub1
}
Currently, I am using a server for e
Thanks for very subtle suggestion. I do agree with you and follow this
strategy (to use programming language for processing the url arguments).
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,242547,242565#msg-242565
___
nginx mailing list
ngi
I have a set of rewrites as
rewrite ^/(.*)/(.*)/(.*)\.(.*) /script.php?a=$1&b=$2&c=$3&ext=$4 last;
rewrite ^/(.*)/(.*)\.(.*) /script.php?a=$1&b=$2&ext=$3 last;
rewrite ^/(.*)\.(.*) /script.php?a=$1&ext=$2 last;
rewrite ^/(.*)/(.*)/(.*)/(.*) /script.php?a=$1&b=$2&c=$3&d=$4 last;
rewrite ^/(.*)/(.*)
For serving the PHP scripts, I use this location
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
now I want to keep a folder outside the public folder to be served
Anton Yuzhaninov Wrote:
---
> > rewrite ^/favicon.ico /var/www/media/images/favicon.X.ico last;
>
> This is wrong - you can rewrite to other location, not to path on file
> system.
> Anyway rewrite does not need here, use location.
Sorry, my ba
I want to server favicon from a different place rather than the root folder.
As I explored I have two options
1.
location = /favicon.ico { alias /var/www/media/images/favicon.X.ico; }
2.
rewrite ^/favicon.ico /var/www/media/images/favicon.X.ico last;
As I understand the second one needs an addi