Welcome! Log In Create A New Profile

Advanced

Requests not passed to FCGI

Posted by AnrDaemon 
Requests not passed to FCGI
June 04, 2017 11:09AM
upstream site-main-5.6 {
server php-5-6.example.org:1008;
}

server {
listen 80;
server_name site-main.example.org;

root "/home/site-main/htdocs";

location ^~ /gallery/test/ {
default_type "text/plain";
#return 200 "@app root.";
try_files $uri @app;
autoindex off;
}
location @app {
default_type "text/plain";
#return 200 "@app root.";

rewrite_log on;
error_log "/home/site-main/logs/error.debug.log" debug;

include extra/fastcgi_php_fpm;

fastcgi_param SCRIPT_FILENAME "/home/site-main/app/app.php";

fastcgi_pass site-main-5.6;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# deny access to .ht* files
location ~ /\.ht {
deny all;
}
}


This configuration just does not work, unless local webroot mirroring FCGI remote FS.
nginx doesn't even TRY to pass the request to the backend, unless it sees a matching local file.
What I'm missing?
Re: Requests not passed to FCGI
June 05, 2017 05:43PM
Found my mistake. I've had

if (!-f $document_root$fastcgi_script_name) {
return 404;
}

hidden deep within includes. Didn't notice it until now.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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