nginx + php-fpm: REQUEST_URI disappears for files that end with .php

Francis Daly francis at daoine.org
Fri Mar 9 00:01:16 UTC 2018


On Thu, Mar 08, 2018 at 01:48:41PM +0200, ST wrote:

Hi there,

* What request do you make? (e.g. /rus_example.php)
* Does the matching file exist on the filesystem
(e.g. /usr/local/nginx/html/rus_example.php)?
* If yes - what response do you want, and what response do you get?
* If no - what response do you want, and what response do you get?

> error_page 404 = /netcat/require/e404.php;
> 
> location ~ \.php$ {
>          if ($args ~ "netcat_files/") {
>              expires 7d;
>              add_header Cache-Control "public";
>          }
> 
>         fastcgi_split_path_info ^(.+\.php)(/.+)$;
>         try_files $uri =404;

If /usr/local/nginx/html/rus_example.php does not exist, that line
says "return 404", which the error_page line turns into a request for
/netcat/require/e404.php

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list