Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't find a mistake in my NGinx config. I have a website launched on http://local_ip:8079 and need to make it accesible by outer usage by the url So, page served localy at url http://local_ip:8079/home.html to be accessible by and so on. I made a config:

    listen 80;
    location /judge/
        proxy_pass http://local_ip:8079/;
        proxy_redirect /;
        proxy_set_header Host $proxy_host;

Pages are loaded but scripts and images appear in webpage source with unchanged url (i.e. /style.css) and are not loaded by browser. Which directive I should add?

share|improve this question

proxy_redirect will only rewrite redirect headers, not the HTML content needed for this to work. There is no easy way to rewrite the HTML content in Nginx.

There is the HttpSubModule, which you can manually add text substitutions, but is lengthly to set up each substitution:

It is easliest if possible to just update the content at http://local_ip:8079/ to have the redirected path in instead.

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.