Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By beaudierman
I’m trying to set up a proxy to my Wordpress blog using proxy_pass but I’m getting some very strange behavior. My Wordpress blog is located at blog.example.com/blog/ and the website at www.example.com, I’d like the blog to appear at www.example.com/blog/. Here’s the code I have, which works for viewing the blog but not for any PHP scripts(logging in, wp-cron, etc all results in “No Input File Specified” error) on the blog:
location /blog/ {
expires off;
proxy_pass http://blog.example.com/blog/;
}
Here is the output in my nginx error log when trying to access the wp-admin page:
2015/02/08 14:28:33 [error] 20572#0: *594485 FastCGI sent in stderr: "Unable to open primary script: /home/user/www.example.com/public/blog/wp-login.php (No such file or directory)" while reading response header from upstream, client: 10.0.1.214, server: www.example.com, request: "GET /blog/wp-login.php?redirect_to=http%3A%2F%2Fblog.example.com%2Fblog%2Fwp-admin%2F&reauth=1 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.example.com"
It appears that any PHP script is hitting my .php block:
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
Any help is greatly appreciated.