1

I'm trying to Proxy Pass /do/uploads.php?id=xxx to /do/upload?id=xxx in Nginx

Here is my try

location /do {
    rewrite /do/uploads\.php /do/uploads$1 break;
    proxy_pass          http://domain/do;
    proxy_set_header    Host $host;
    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto $scheme;
    proxy_set_header    X-Real-IP $remote_addr;
}

1 Answer 1

0

I found a solution. Here it is:

location = /do/uploads.php {
    proxy_pass          http://domain/switch/do;
    proxy_set_header    Host $host;
    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto $scheme;
    proxy_set_header    X-Real-IP $remote_addr;
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .