0

Here is a URL : http://123.com/stat/api/abc?a=123

if I want to set proxy pass to : http://456.com/api/abc?a=123

My nginx config as below :

server {
        listen         80;
        server_name    123.com;
        location /stat {
             proxy_pass http://456.com;
        }
}

And this is not work. Any ideas?

1 Answer 1

1

Finally, I found the solution. The final config as below :

location /stat/ {
        proxy_pass http://456.com/;
}

the end of slash in location section and proxy_pass section must be have.

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.