Welcome! Log In Create A New Profile

Advanced

Re: index or try_files in reverse proxy

August 13, 2009 06:24AM
On Thu, Aug 13, 2009 at 06:15:08AM -0400, meto wrote:

> Igor, unfortunately, your config doesn't work as expected. I'm using this config right now and it works for me:
>
> location / {
> index index.html index.htm index.php;
>
> try_files $uri $uri/ @proxy_backend;
> }
>
> location ~ ^(.+\.php)(.*)$ {
> try_files $uri @proxy_backend;
>
> fastcgi_pass php;
>
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> fastcgi_intercept_errors on;
> fastcgi_buffers 100 32k;
> fastcgi_read_timeout 600;
>
> include fastcgi_params;
> }

Yes, this configuration works, since "/" is tested successfully by "$uri/".
Then the request is run inside "location /" and nginx looks for index files
and after it will find "/index.php", it does interanl redirect to
"/index.php", which is handled in "location ~ ^(.+\.php)(.*)$".


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

index or try_files in reverse proxy

meto August 12, 2009 03:27PM

Re: index or try_files in reverse proxy

meto August 12, 2009 07:47PM

Re: index or try_files in reverse proxy

edogawaconan August 13, 2009 12:40AM

Re: index or try_files in reverse proxy

Igor Sysoev August 13, 2009 03:22AM

Re: index or try_files in reverse proxy

meto August 13, 2009 06:15AM

Re: index or try_files in reverse proxy

Igor Sysoev August 13, 2009 06:24AM

Re: index or try_files in reverse proxy

meto August 13, 2009 10:13AM

Re: index or try_files in reverse proxy

Igor Sysoev August 13, 2009 02:13PM

Adding tests for handlers and filters

Marcus Clyne August 13, 2009 06:05PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 98
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready