Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Here is my current config:

server {
    location ~ ^/bugsbunny/?(.*)$ {
        proxy_set_header Host $host;

I've been trying to figure out how to reverse-proxy requests and preserve the original host. For example let's say I have as my front-end and I want to reverse-proxy the requests to How to preserve the original url so that would become on the front-end ?

P.S. I tried using proxy_set_header Host $host; but this preserves only the original host.

share|improve this question

1 Answer 1

Actually I found it myself. You have to rewrite the links yourself via HttpSubModule. Be sure to set sub_filter_once off so that it replaces all the links on the page, not just the first one it finds.

share|improve this answer

Your Answer


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.