I have sucessfully proxy passed tomcat 1XX.XXX.XXX.XXX:8080 to 1XX.XXX.XXX.XXX through NGINX . Both 1XX.XXX.XXX.XXX:8080 and 1XX.XXX.XXX.XXX has and shows same thing.
server{ listen 80;
server_name 1XX.XXX.XXX.XXX
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;
}
But what i want is to show content through reverse proxy only i.e 1XX.XXX.XXX.XXX , if i enter 1XX.XXX.XXX.XXX:8080 i want to display error page or redirect back to 1XX.XXX.XXX.XXX . How do i do it ? Thanks in advance :) .