Wordpress on Sub Directory with Nginx using Proxy Pass with No Input File error Wordpress on Sub Directory with Nginx using Proxy Pass with No Input File error wordpress wordpress

Wordpress on Sub Directory with Nginx using Proxy Pass with No Input File error


You should be able to specify just index index.php;.

You should also change

location / { try_files $uri $uri/ /blog/index.php?$query_string; }

to

location / { try_files $uri $uri/ /blog/index.php?$args; }

and change:

fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;

to:

fastcgi_split_path_info ^(/blog)(/.*)$;fastcgi_pass php;

This is coming from the WordPress documentation as well as the NGINX documentation.


maybe rewrite the /blog path to supress the prefix?

server{  ...  location /blog {        #strip the '/blog' prefix        rewrite /blog/(.*) /$1  break;        proxy_set_header X-Real-IP  $remote_addr;        proxy_set_header X-Forwarded-For $remote_addr;        proxy_set_header Host $host;        proxy_pass https://blog;    }}


The reason was the upstream was not allowing for any other params ie extension .php, this was the upstream location change..

location ^~ /blog {    proxy_set_header X-Real-IP  $remote_addr;    proxy_set_header X-Forwarded-For $remote_addr;    proxy_set_header Host $host;    proxy_pass https://blog;}

Hopes this helps anyone else in the future.