B
B
BloodVIRUS2019-06-24 12:39:08
Nginx
BloodVIRUS, 2019-06-24 12:39:08

How to pass a parameter through proxy_pass?

Hello. There are two sites. I want to display the contents of site2.com in the site1.com/admin directory. But at the same time, on site2.com , I must understand that it was opened through site1, or was opened directly through site2. in the nginx config, I made a proxy_pass for the /admin/ directive, but I don’t know how to pass at least some parameters. Google suggests options set $args branding=1&$args; proxy_pass http://site1.pixliapp.com$args; But all of them either do not work, i.e. there is nothing in $_SERVER, or they give HTTP500. Please tell me what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-06-24
@BloodVIRUS

location /admin/ {
    rewrite (.*) $1?branding=1 break;
    proxy_pass http://site2.com;
}

K
ky0, 2019-06-24
@ky0

Pass not through arguments, but in the header.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question