0

I am trying to set up nginx as reverse proxy for a tomcat server using SSL connection.

I want the client's browser to load my tomcat application when nginx reverse proxy's IP is called from client's browser.

My tomcat application's address is 192.168.25.25 and nginx proxy's address is 192.168.25.50

In my nginx.conf file i have added these lines

location / {
   proxy_pass https://192.168.25.25:443/myapp/;
   proxy_redirect https://192.168.25.25/myapp/ https://192.168.25.25/;
}

Some of the images in my application is stored at 192.168.25.25/images/ .

Now these directories cant be accessed as the proxy_pass is set to 192.168.25.25:443/myapp.

Is there way to access images directory also without changing proxy_pass ?

Thanks in advance.

Lekensteyn
  • 6,111
  • 6
  • 37
  • 55

1 Answers1

1

You'll want to add a new location block for /images, avoiding the proxy directive that's sticking you to where /images wouldn't be accessible.

location /images/ {
    proxy_pass https://192.168.25.25/images/;
}
Shane Madden
  • 112,982
  • 12
  • 174
  • 248