E
E
explay222017-04-06 13:00:34
Nginx
explay22, 2017-04-06 13:00:34

How to properly proxy in nginx?

Is it possible that, for example, for the site.ru/http://google.ru request, proxying was on google.ru
, I try, but for some reason all to no avail

location ~ /(.*) {
        proxy_pass   $args ;
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-04-06
@explay22

merge_slashes off;
location ~ ^/proxy/(.*)$ {
    resolver 8.8.8.8;
    proxy_pass $1;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question