Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Proxy #38

Closed
intlabs opened this issue Mar 25, 2015 · 2 comments
Closed

Reverse Proxy #38

intlabs opened this issue Mar 25, 2015 · 2 comments

Comments

@intlabs
Copy link

intlabs commented Mar 25, 2015

Hi,

I'm trying to put node-unblocker behind a reverse proxy for intranet access:

I need to have under a subdirectory, and have modified the code to point to /foo/bar as it's root and it is working perfectly on it's own. But when I put nginx infront of node-unblocker I get stuck in a redirect loop:

curling node-unblocker directly results in the expected output:

curl -i http://172.16.6.168:800/foo/bar/proxy/http://example.com/
**expected output**

while the proxy returns:

curl -i http://172.16.6.168/foo/bar/proxy/http://example.com
HTTP/1.1 307 Temporary Redirect
Date: Wed, 25 Mar 2015 13:28:05 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: unblocker.sid=s%3AOWn3F7Kx4eGCwtoTxgeui6ui.w0vbLLD3wwWYHCXUQly85wTf0PhwEj9S89ccLrhrQCo; Path=/
location: http://172.16.6.168/foo/bar/proxy/http://localhost/foo/bar/proxy

The relevant section of my nginx config is:

location /foo/bar/ {
        proxy_pass        http://X.X.X.X:XX/foo/bar/;
        proxy_http_version 1.1;
        proxy_pass_header Server;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        }

Im sure i must be missing something pretty simple? If you had any pointers it would be greatly appreciated.

Cheers

Pete

@intlabs intlabs closed this as completed Mar 26, 2015
@intlabs
Copy link
Author

intlabs commented Mar 26, 2015

Fixed it:

merge_slashes off;

and its great :)

nice little proxy too!

@nfriedly
Copy link
Owner

Hey, sorry, I've been sick an not very responsive for the the past couple of days, but I'm glad to hear that you figured it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants