I have an app working on port 8080 perfectly with the domain desh.onecloudhelper.com and now when I hit the Public IP address of the Server, I can still view the same app running using the server’s public IP address.
What I am trying to achieve is that If someone uses the [IPaddress:8080] to access the site, that request should be blocked but when someone accesses the site using the [domainname:8080], that request should not be blocked through the browser.
This is the config file that I am using:
server {
listen 80;
server_name desh.onecloudhelper.com;
location / {
proxy_pass http://localhost:8080;
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-Proto $scheme;
}