Alexander2016-12-17 22:16:46
Alexander, 2016-12-17 22:16:46

3rd party site proxy in location?

Good day. Rummaged through a bunch of information, tried a bunch of options, but did not achieve the desired result. The point is this. It is necessary to configure NGINX in such a way that when accessing site1.ru/adb/help.php, the page located at site2.ru/adb/help.php opens. Config
piece from site1.ru:

location /adb/ {
        proxy_set_header HOST $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://site2.ru/;

Push in the right direction.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Erelecano Oioraen, 2016-12-17

Do you want something like this?

location / {
        proxy_pass https://toster.ru;

And actually everything works :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question