Proxy pass confusion

Jon Drukman jdrukman at
Fri Aug 24 20:40:27 UTC 2012

Here is my server setup:

Amazon load balancer ( -> nginx servers in
reverse-proxy/caching mode -> back end PHP servers

If I visit the nginx server directly in my browser, everything works

If I visit, the nginx server redirects me to
http://decupstream, which is what I named the upstream block in my
configuration.  The nginx.conf looks like:

 upstream decupstream {

    proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=gop2012:10m;

    server {
        listen       80;

        location / {
          proxy_pass            http://decupstream;
          proxy_cache           gop;
          proxy_cache_valid     10m;
          proxy_cache_use_stale error timeout invalid_header http_500;
          proxy_next_upstream   error timeout invalid_header http_500;
          proxy_cache_lock      on;
          proxy_ignore_headers Cache-Control Expires;
          proxy_set_header Host "";

How do I get nginx to forward requests to the Apache/PHP servers even if
they don't come in directly to the nginx box?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list