I have setup nagios on my Ubuntu, but when I go to my IP address, it downloads a BIN file. Why is this happening? The address is:
You appear to be running an ssh server on your http/https ports:
nc -vvv 126.96.36.199 80 Connection to 188.8.131.52 80 port [tcp/http] succeeded! SSH-2.0-dropbear_2016.72 nc -vvv 184.108.40.206 443 Connection to 220.127.116.11 443 port [tcp/http] succeeded! SSH-2.0-dropbear_2016.72
If you're trying to run ssh and http/https on the same port I would strongly recommend that you keep things simple until you have all your services working correctly, and instead (at least for now) separate them out.
You can then start to investigate the problem that you have described, knowing that you have just a single application (i.e. your webserver) to consider.
Something in your Web server configuration is broken, as here's what curl says...
imac> curl -I -L http://18.104.22.168/nagios curl: (8) Weird server reply
First time I've ever seen this type of response. Same for your raw IP...
imac> curl -I -L http://22.214.171.124 curl: (8) Weird server reply
Start with your Web server logs.
Also, thinking through this, a misconfigured iptables rule to attempt dealing with some types of attack traffic might be at fault, so if you have any iptables rules associated with port 80 on this IP, flush the related rules for now.
Likely your Webserver access + error logs will help.
Get your actual Webserver working first... so serving a simple index.html first, before attempting to setup anything complex.