# Nginx reverse proxy for tomcat

**URL:** <https://www.ruby-forum.com/t/nginx-reverse-proxy-for-tomcat/204016>\
**Category:** NGINX\
**Created:** [March 3, 2011, 12:16pm UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-for-tomcat/204016 "2011-03-03T12:16:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 3, 2011, 12:16pm UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-for-tomcat/204016/1 "2011-03-03T12:16:30Z")

</div>

Hi.

I am new to nginx.  
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/](https://192.168.25.25/);

## The links in my application work only when i do this redirection.

}  
########################################################

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

Now this cant be accessed once i made the change proxy\_pass

Is there way to access images directory also without changing  
proxy\_pass ?

Thanks in advance.

Posted at Nginx Forum:

> **[Nginx reverse proxy for tomcat](https://forum.nginx.org/read.php?2,179915,179915#msg-179915)**
>
> Hi. I am new to nginx. 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 tom

---

<div class="post-metadata">

**Author:** ![krish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c57346/32.png) [@krish](https://www.ruby-forum.com/u/krish)\
**Post date:** [March 7, 2011, 12:19pm UTC](https://www.ruby-forum.com/t/nginx-reverse-proxy-for-tomcat/204016/2 "2011-03-07T12:19:19Z")

</div>

I added another location to rewrite the request and now its working  
fine.

location ~ /myapp/ {  
rewrite ^/myapp/(.\*)$ [https://myservername/$1](https://myservername/$1) redirect;  
}

Posted at Nginx Forum:

> **[Re: Nginx reverse proxy for tomcat](https://forum.nginx.org/read.php?2,179915,180974#msg-180974)**
>
> Hi. I am new to nginx. 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 tom
