Proxy Pass Redirect Problem

Not sure if this is my configuration causing this symptom or openresty.

Here is whats happening.

If I try to access the store “admin”
via: http://mysite.com/admin

I am getting proxy redirects sent to my browser and seeing
127.0.0.1:8000/admin in my address bar.

Not exactly the result I was looking for.

Any pointers where I should look?

Running ngx_openresty/1.4.3.6

Here is my config

     location / {
         root  html;
         index index.php index.html index.htm;
         try_files $uri @store;
     }
     location @wsgi {
             include uwsgi_params;
             uwsgi_pass unix://tmp/spften.sock;
     }

     location @store {
             include uwsgi_params;
             proxy_pass http://127.0.0.1:8000$uri;
             proxy_intercept_errors on;
             #recursive_error_pages on;
             error_page 404, 502 = @wsgi;
     }

Thanks in advance for any pointers.

Hello!

On Fri, Dec 13, 2013 at 12:25:02PM -0500, david wrote:

Not exactly the result I was looking for.
try_files $uri @store;
}
location @wsgi {
include uwsgi_params;
uwsgi_pass unix://tmp/spften.sock;
}

    location @store {
            include uwsgi_params;
            proxy_pass http://127.0.0.1:8000$uri;
  •             proxy_pass http://127.0.0.1:8000$uri;
    
  •             proxy_pass http://127.0.0.1:8000;
    

See also docs here:

http://nginx.org/r/proxy_pass
http://nginx.org/r/proxy_redirect

Default proxy_redirect should work for you if you’ll remove “$uri”
as suggested above.


Maxim D.
http://nginx.org/

Nevermind. I found my error.

I was doing kill -HUP and had a typo in my config.

I didnt notice until I checked the config.

Thank you its working as expected.

Sorry for the noise.

Maxim!

Thank you.

I must of missed something because it does not seem to solve my issue.

I removed the $uri param from the proxy_pass.

I also tried adding proxy_redirect

(But I think that belongs to the @wsgi block and not the @store block.
But I am not exactly sure.)

Because my understanding is that its getting sent to the @wsgi app thats
what is issuing the redirect and using the proxy pass address to rewrite
the uri.

location @wsgi {
include uwsgi_params;
uwsgi_pass unix://tmp/spften.sock;
}

location @store {
include uwsgi_params;
proxy_pass http://127.0.0.1:8000;
proxy_redirect http://127.0.0.1:8000 /;

proxy_redirect default;

             proxy_intercept_errors on;
             #recursive_error_pages on;
             error_page 404, 502 = @wsgi;
     }

Perhaps I misunderstood how this works.

Thanks in advance for any pointers.