Answer the question
In order to leave comments, you need to log in
How to replace subdomain in http header in nginx?
You need to replace the proxied header for gunicor that nginx passes to it. Let's say I request the name dev.example.com and gunicorn is given just example.com. I just managed to remove the subdomain as follows:
location / {
proxy_pass http://unix:/var/run/gunicorn/gunicorn.sock;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host example.com;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question