NginX problem with Reverse Proxy'ing

Maxim Dounin mdounin at mdounin.ru
Sat Apr 10 22:05:22 MSD 2010


Hello!

On Sat, Apr 10, 2010 at 05:36:19PM +0200, Victor wrote:

> Hi, I have a little problem that's driving me crazy since 4 days. I'm trying
> to create a server with NginX (0.8.35) serving static content (PDF files
> mainly) as frontend and Apache2 as backend processing the PHP files,
> actually I'm working only with basic PHP (phpinfo()) files for testing
> purposes (this isn't my production machine, only a
> pre-production-kind-machine. Apache is running in 127.0.0.1:8080
> 
> When I'm trying to proxy the PHP to Apache is issuing a 301 Redirection (i
> tested it with cURL from another host, and giving a network error in IE8 and
> Chrome.
> Here I include the config files loaded in Nginx:

[...]

> Now the -i from cURL in blog.foo.com/index.php
> HTTP/1.1 301 Moved Permanently
> Server: nginx/0.8.35
> Date: Sat, 10 Apr 2010 15:34:45 GMT
> Content-Type: text/html; charset=UTF-8
> Connection: keep-alive
> X-Powered-By: PHP/5.2.10-2ubuntu6
> X-Pingback: http://127.0.0.1:81/xmlrpc.php
> Location: http://blog.foo.com:81/

So, your php code returns 301 redirect.  Probably it's a good idea 
to look into your php code?..

Maxim Dounin



More information about the nginx mailing list