Is there a way in nginx to proxy any url?

by nginxdreams   Last Updated September 11, 2019 19:00 PM

I would like to have an api like this:

my-proxy-server.com/http://example.com/foo.pdf

that streams a response from http://example.com/foo.pdf. Note in this case http://example.com/foo.pdf is just an example, this could be any pdf url.

So in nginx.conf sudo code:

    location ~* ^/(?<urlpath>.*)$ {
      proxy_pass $urlpath;
    }

Is this possible with nginx + some other plugin? Looking for some pointers on implementing this.

Tags : nginx proxypass


Related Questions


Updated April 04, 2015 05:00 AM

Updated July 24, 2019 07:00 AM

Updated June 02, 2016 08:00 AM

Updated February 15, 2017 14:00 PM