0

I am trying to configure Nginx as a proxy to http://example.com/test/app

My config is similar to this :

server {
    listen 80;
    location  / {
        proxy_pass http://example.com/test/app;
    }
}

I am getting 301 response. I don't think this is something related to the web app the proxy is referring to, because its url is accessible via the browser.

I am quite new to Nginx. Please help. :)

1 Answer 1

1

please try the following bare minimum configuration:

server {

  listen 80;

  location / {

  proxy_set_header        Host $host;
  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;

  # Fix the "It appears that your reverse proxy set up is broken" error.
  proxy_pass          http://example.com/test/app;
  proxy_read_timeout  90;

  }
}

Please note that security aspects are missing in this example.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.