3

What I like to do is to proxy requests from http://example.com/proxy/foo to http://localhost:8060/foo

This config proxies http://example.com/proxy/foo to http://localhost:8060/proxy/foo

server {
    server_name example.com;


    location /proxy/ {
        proxy_pass http://localhost:8060;
    }

    location / {
        proxy_pass http://localhost:8040;                                                            
    }

}
5
server {
    server_name example.com;


    location ^~ /proxy/ {
        rewrite ^/proxy(/.*)$ $1 break;    
        proxy_pass http://localhost:8060;
    }

    location / {
        proxy_pass http://localhost:8040;                                                            
    }

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.