Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Alright so I'm using nginx to forward communication to and from my server and clients. My server receives the communication via port 6543, and nginx forwards it to that port on that server (from port 80 on the nginx proxy server)

It works fine if I enter http://mydomain.com/directory/ <- note the trailing slash

but if i enter http://mydomain.com/directory <- no trailing slash

it becomes http://mydomain.com:6543/directory/ which of course doesn't work, because the nginx server isn't expecting anything on that port.

I can't figure out how to fix this. Help?

share|improve this question
    
You'll get better answers if you post your nginx configuration. –  ChrisV Jul 24 '11 at 22:35
    
I don't think that's going to help with only 8 views, anyway. –  Rob Jul 24 '11 at 22:48

2 Answers 2

You need to set port_in_redirect to off on the back-end server use proxy_redirect on the front-end server.

share|improve this answer
    
Man I am failing so terribly. –  Rob Jul 25 '11 at 21:34

You would have to rewrite your application to redirect to a different port than the one it thinks it's using.

Also, some proxy/caching servers do have utilities for stripping a port number from a redirect. Yet I don't recall NGINX having this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.