When using FQDN as URL, Views page asks for login

This support forum board is for questions relating to Nagios Fusion.
Locked
WillH
Posts: 54
Joined: Mon Aug 03, 2020 10:37 am

When using FQDN as URL, Views page asks for login

Post by WillH »

When using the plain language DNS or FQDN in the url, going to Views prompts the users to enter their credentials.
Example:
https://OurFusion/nagiosfusion or https://OurFusion.ourdomain.com/nagiosfusion behave this way
https://192.168.1.200/nagiosfusion works as expected, displaying the views and cycling through them

After entering credentials the app either redirects them to the IP address style of address, and another login, OR it gives them the "NSP: Sorry Dave, I can't let you do that" error message

Screen shot attached.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: When using FQDN as URL, Views page asks for login

Post by ssax »

This is because of SSL and how it works, those are all different hosts in terms of SSL connections (short name vs FQDN vs IP when different from what you have in the address bar of your browser will force you to login to the others) which is why that occurs, they all need to match (or you need to force apache to redirect them to what you want).

What URL do you go to when you open up your address bar?

What do you have set for Admin > System Settings > Internet URL and Public URL?
WillH
Posts: 54
Joined: Mon Aug 03, 2020 10:37 am

Re: When using FQDN as URL, Views page asks for login

Post by WillH »

The internal URL and public URL are both set to http://<severname>/nagiosfusion

When using this URL, and using the Views sub page, the user is either redirected to the IP address and the login, or it will put the login page nested into the frame
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: When using FQDN as URL, Views page asks for login

Post by ssax »

It looks like those links use the IP address on my system as well, I'm looking at the code and will update you shortly.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: When using FQDN as URL, Views page asks for login

Post by ssax »

Please click Views > Manage My Views:
- Edit the links and change them from IP address to the URL you are using in your web browsers address bar

Then test.

If they aren't IP addresses, let me know.
WillH
Posts: 54
Joined: Mon Aug 03, 2020 10:37 am

Re: When using FQDN as URL, Views page asks for login

Post by WillH »

Ah, that's the trick. It seems we have one, or the other.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: When using FQDN as URL, Views page asks for login

Post by ssax »

On the backend it's using $_SERVER['SERVER_NAME'] for the links so it's likely defaulting to the IP address/whatever is returned by apache ServerName directive when building those URLs.

I noticed that if I changed the ServerName apache variable/restarted httpd and then created a new user it would use that new SERVER_NAME for new users views. The others would need to be changed manually like you did, it only works on new user creation when creating those default dashboards.
Locked