Reputation: 1235
I'd like to configure nginx in such a way that:
A request for http://nginx-proxy-server.com/location1/filename.bin
is proxied to http://location1.my-application-server.com/filename.bin
How can I accomplish that?
Upvotes: 1
Views: 2910
Reputation: 1503
location ~ ^/(.+)/(.*)$ {
resolver 1.1.1.1 8.8.8.8;
proxy_pass http://$1.my-application-server.com/$2$is_args$args;
}
Upvotes: 5