project path use as domain in nginx -tomcat -
spring java project run in server. added new domain, works, when click link goes http://127.0.0.1:8081/ instead of example.com
server { listen 80; server_name www.example.com example.com; root /opt/appserv/travel_server/webapps/example; location ~* \.(js|jpg|png|css)$ { root /opt/appserv/travel_server/webapps/example/; expires 30d; } location / { proxy_set_header x-forwarded-host $host; proxy_set_header x-forwarded-server $host; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8081/example; } }
server { listen 80; server_name www.example.com example.com #server_name_in_redirect off; root /opt/appserv/travel_server/webapps/example; location ~* \.(js|jpg|png|css)$ { root /opt/appserv/travel_server/webapps/example/; expires 30d; } location ~* ^/(.*) { proxy_set_header x-forwarded-host $host; proxy_set_header x-forwarded-server $host; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8081/example/$1; } }
Comments
Post a Comment