G
G
gremlintv22018-03-11 15:00:38
Nginx
gremlintv2, 2018-03-11 15:00:38

How to write such a location for NGINX?

It is necessary that everything that comes to:

server.com/index.php?r=iframe/index& .

redirected to the server stack:
server1.com/index.php?r=iframe/index&
server2.com/index.php?r=iframe/index&
..

That doesn't work :(
upstream balancer {
server server1.com weight=20 max_conns=500 fail_timeout=5s;
server server2.com weight=20 max_conns=500 fail_timeout=5s;
...
}

location ~ /index.php?r=iframe/index\&$ {
proxy_pass http://balancer;
include proxy.inc;
proxy_set_header X-Forwarded-Proto $thescheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Godless, 2018-06-07
@gremlintv2

redirected to the server stack:

Simultaneously? And from which server will nginx have to give the response to the client?
And it shouldn't, these are variations of forwarding to one server. The balancer also sends to one of.
They would at least google it. Here is the same question.
Docks
location / {
    mirror /mirror;
    proxy_pass http://backend;
}

location /mirror {
    internal;
    proxy_pass http://test_backend$request_uri;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question