Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx as reverse proxy - must point to different web servers

$
0
0
Hello,

i'm a newbie on Nginx and i have this problem :

We have Nginx as reverseproxy who point on a Java server (Platform play) - That's ok and work well :

https://www.toto.fr

Now we would like to point to our Nagios server when we enter this URL https://www.toto.fr/supervision/

For this, i have this block :

location /supervision {
proxy_pass http://IP_SERVER_NAGIOS/nagios/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Ssl on;
access_log /var/log/nginx/supervision.access.log;
}

That's work too ! I access well on the start page of Nagios. But when i click on another link of Nagios web interface, Nginx doesn't find the pages because the links point to http://www.toto.fr/nagios/cgi-bin/.... and not to http://www.toto.fr/supervision/cgi-bin/...

What is the way to resolve this problem ? an 'if' condition, a rewrite URL, a new location block ? Can you help me please ?

Thanks

Doctau

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>