Welcome! Log In Create A New Profile

Advanced

Re: Questions about Internal named location

July 30, 2010 03:50PM
On Fri, Jul 30, 2010 at 09:26:42PM +0200, Rob Schultz wrote:

> > This all started when I tried to setup one nginx server that has
> > multiple php sites under one url that needs a alias for the other sites.
> > Something like this:
> >
> > root /var/www/somesite;
> >
> > location / {
> > index.html index.php;
> > }
> > location /wordpress {
> > alias /var/www/wordpress;
> > try_files $uri $uri/ @wordpress;
> > }
> > ....
>
> from the wiki http://wiki.nginx.org/Wordpress
> might try this format
> location /wordpress {
> try_files $uri $uri/ /wordpress/index.php?q=$uri&args;
> }
>
> and then have your normal php location block for fastcgi settings.

It's better to set a script name and a query string directly in
fastcgi_param to avoid surplus copy operations:

location /wordpress {
root /var/www;
try_files $uri $uri/ @wordpress;
}

location @wordpress {
...
fastcgi_param SCRIPT_FILENAME /var/www/wordpress/index.php;
fastcgi_param QUERY_STRING q=$uri&$args;
}


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Questions about Internal named location

heimdull July 30, 2010 02:31PM

Re: Questions about Internal named location

Rob Schultz July 30, 2010 03:46PM

Re: Questions about Internal named location

Igor Sysoev July 30, 2010 03:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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