Eric Wu
Eric Wu

Reputation: 45

Nginx Proxy Pass parameter issue

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?

Upvotes: 0

Views: 265

Answers (1)

Eric Wu
Eric Wu

Reputation: 45

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.

Upvotes: 1

Related Questions