I am using Nginx and am using proxy_pass to proxy through to upstream application server. This is working fine, however the server responds with https://domain.com:81/

How can I rewrite the host from https://domain.com:81/ to https://domain.com/


you don't need to rewrite the host, you only specify the port in your upstream.


upstream someproxy { 
    server X.X.X.X:81; 


server {
    listen 80;
    server_name domain.com
    ..... //location, proxy_pass, ...

And it should work as intended.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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