If I have a domain, for example, http://www.example.com , and I would like to redirect all requests from http://www.example.com/test to http://www.example.com:3000 , how to do it right?
I tried the following:
location /test { proxy_pass http://www.example.com:3000; proxy_set_header Host $host; }
But what he does really redirects http://www.example.com/test to http://www.example.com:3000/test , and that is not what I want.
How can I do it right?
UPDATE:
While Krizna answer worked, it redirects me to my domain as expected.
But now I want my browser bar to be http://www.example.com/test instead of http://www.example.com:3000 . If I understand correctly, I have to install nginx to catch the answer and send it back to the URL requested by the user. How to do it?
source share