Treeview changed when logging in via Nginx-Reverse proxy

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
dragon2611
Posts: 15
Joined: Sun Mar 21, 2010 8:54 am

Treeview changed when logging in via Nginx-Reverse proxy

Post by dragon2611 »

I'm Sure it's something very silly, but I have a cacti installation sitting behind an Nginx Reverse Proxy (Mostly to save on Public Ipv4's and partly because I can)

When I access cacti via the proxy the Tree view ends up as shown in the screenshot with everything expanded and no option to collapse the various levels.

If I access the Cacti VM directly bypassing the proxy however the tree displays as expected and I can expand/collapse sections so I guess the Proxy is screwing something up, but I'm not sure what.

Edit Nginx config for cacti.mydomain..net

Code: Select all

server {
listen 80;
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/cacti.crt;
ssl_certificate_key /etc/nginx/ssl/cacti.key;
server_name cacti.mydomain.net/;

location / {
rewrite / $scheme://cacti.mydomain.net/cacti/ redirect;
}
location /cacti {
proxy_pass http://10.0.255.210/cacti;
proxy_pass_request_headers      on;
proxy_set_header        X-Real-IP $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header        Referer $http_referer;
proxy_pass_header       Set-Cookie;
proxy_set_header Host $host;
proxy_set_header Cookie $http_cookie;
}
}
Attachments
tree-view.png
tree-view.png (9.58 KiB) Viewed 1117 times
dragon2611
Posts: 15
Joined: Sun Mar 21, 2010 8:54 am

Re: Treeview changed when logging in via Nginx-Reverse proxy

Post by dragon2611 »

Found the problem

Cacti is requesting

"GET /javascript/jquery-cookie/jquery.cookie.js HTTP/1.1" which seems to reside outside the cacti folder (This was a installation installed by the ubuntu package manager)

So this wasn't hitting the location block within Nginx.

Since I have cacti on a cacti.mydomain.net virtual host I reconfigured it as follows

Code: Select all

location / {
proxy_pass http://10.0.255.210/;
proxy_pass_request_headers      on;
proxy_set_header        X-Real-IP $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header        Referer $http_referer;
proxy_pass_header       Set-Cookie;
proxy_set_header Host $host;
proxy_set_header Cookie $http_cookie;
}
I then put an index.html on my Cacti server with a meta refresh pointing at /cacti , which whilst not really needed saves me having to remember to type /cacti )

There is probably a better way to do it, but it works.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests