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?