I am using nginx server (nginx version: nginx/1.10.0 (Ubuntu))
created a Tomcat 8 configuration in /etc/nginx/conf.d/tomcat.conf
server {
listen 80;
root /opt/tomcat/webapps/ROOT/;
server_name mysite.com;
server_name_in_redirect off;
access_log /var/log/nginx/site/site_access.log;
error_log /var/log/nginx/site/site_error.log debug;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cookie_path ~*^/.* /;
proxy_pass http://localhost:8080;
}
}
www.site.com
is showing Welcome to nginx and my tomcat project is showing on http://ip:8080
.
Problem is www.site.com
is not redirecting to 8080