Welcome! Log In Create A New Profile

Advanced

Re: nginx proxypass issue

Maxim Dounin
March 21, 2014 08:14AM
Hello!

On Fri, Mar 21, 2014 at 11:22:42AM +0530, Geo P.C. wrote:

> We have a setup in which nginx proxypass is working fine for tomcat like
> this:
>
> server {
> listen 80;
> server_name app.geo.com;
> location /app {
> proxy_pass https://192.168.1.100:8080/app;
> }
>
> Now while accessing http://app.geo.com/app is working fine.
>
> Now we need to access the same application as
> http://app.geo.com/paymentbut we need the tomcat war as same app. We
> configured proxypass as follows:
>
> server {
> listen 80;
> server_name app.geo.com;
> location /payment {
> proxy_pass https://192.168.1.100:8080/app;
> }
>
> But while accessing http://app.geo.com/payment tomcat application app is
> not loading properly. We are not getting any reliable error message.
>
> Can any one please help us to configure on this scenario.

Most likely, the problem is that your backend links various
resources (e.g., images) using "/app/" url prefix, while
externally visible prefix is "/payment/".

Simpliest and most reliable solution is to fix/change backend to use
links you need (many apps have configuration options like
"baseurl" or something like this).

As a hack/workaround, you may also try changing prefix using nginx
itself, e.g., using sub_filter[1]. This approach may have
problems and not recommended though.

[1] http://nginx.org/en/docs/http/ngx_http_sub_module.html

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx proxypass issue

geopcgeo March 21, 2014 01:54AM

Re: nginx proxypass issue

Maxim Dounin March 21, 2014 08:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready