Welcome! Log In Create A New Profile

Advanced

index or try_files in reverse proxy

August 12, 2009 03:27PM
I'm trying to set a reverse proxy for some time now and i'm out of ideas...

[code]
index index.html index.htm index.php;

location / {
try_files $uri @proxy_backend;

}

location ~ ^(.+\.php)(.*)$ {

error_page 404 /errors_pages/404.html;

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;
}

location @proxy_backend {

proxy_pass http://IP:80;

access_log off;
expires off;
}
[/code]

Almost everything is fine, but it's not passing domain.com/ to index.php via FastCGI, but goes to proxy :/ other php files are parsed by "php" upstream in nginx including domain.com/index.php (when included in URI).

I also tried commenting index ... and using try_files $uri $uri/index.php, but then it provides index.php as text, ignoring fastcgi server. Am i doing something wrong, or is there a small bug?
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: 287
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