Redirection

Jason Whittington Jason.Whittington at equifax.com
Thu Feb 22 15:55:47 UTC 2018


One easy newbie mistake to make is leaving out trailing slashes for location and proxy_pass blocks.   I'd expect the location block to look something like this:

location /app/ {
   proxy_pass http://tomcatdomain/application_name/;
}

Note the trailing slashes after /app/ and /application_name/. Without them the routing is not going to do what you want.

Jason

-----Original Message-----
From: nginx [mailto:nginx-bounces at nginx.org] On Behalf Of imrickysingh
Sent: Thursday, February 22, 2018 7:18 AM
To: nginx at nginx.org
Subject: [IE] Redirection

Hi guys,

I am new to nginx and facing some problem with my setup.

In my setup i have nginx and tomcat with the application running on tomcat as http://tomcatdomain/application_name. I want to redirect to application if someone hit http://nginxdomain/app. I am able to do the redirection using location block as:

location /app {
  proxy_pass $tomcatdomain;
  proxy_set_header Host $host;
  proxy_pass_request_headers  on;
}

http://nginxdomain/app gives default tomcat page but i am not being able to reach the application.
If i do like: http://nginxdomain/app/application_name, then it doesn't go anywhere but gives me the default tomcat page



Regards,
Ricky Singh

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278722,278722#msg-278722

_______________________________________________
nginx mailing list
nginx at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

This message contains proprietary information from Equifax which may be confidential. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify by e-mail postmaster at equifax.com. Equifax® is a registered trademark of Equifax Inc. All rights reserved.


More information about the nginx mailing list