# Proxypass subfolder entries to another link

**URL:** <https://www.ruby-forum.com/t/proxypass-subfolder-entries-to-another-link/245526>\
**Category:** NGINX\
**Created:** [June 6, 2013, 3:16pm UTC](https://www.ruby-forum.com/t/proxypass-subfolder-entries-to-another-link/245526 "2013-06-06T15:16:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [June 6, 2013, 3:16pm UTC](https://www.ruby-forum.com/t/proxypass-subfolder-entries-to-another-link/245526/1 "2013-06-06T15:16:50Z")

</div>

Dear Support

Currently we have nginx proxypass to tomcat service and is working fine.

server {  
listen 80;  
server\_name [app.geo.com](http://app.geo.com);  
location / {  
if (!-e $request\_filename) { rewrite ^/(._)$ /index.php?q=$1  
last; } }  
location /docs {  
proxy\_pass [http://localhost:8080/officework](http://localhost:8080/officework);  
proxy\_redirect off;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Forwarded-For  
$proxy\_add\_x\_forwarded\_for;  
}  
}  
So while accessing [app.geo.com/docs/](http://app.geo.com/docs/)_ we are getting the contents of  
[http://localhost:8080/officework](http://localhost:8080/officework)

Now we have another tomcat war folder /homework and while accessing  
[app.geo.com/docs/home\*](http://app.geo.com/docs/home*) we need to get the contents of  
[http://localhost:8080/homework](http://localhost:8080/homework)

That is we need as follows:

[http://app.geo.com/docs/](http://app.geo.com/docs/)\* → [http://localhost:8080/officework](http://localhost:8080/officework)

[http://app.geo.com/docs/home/](http://app.geo.com/docs/home/)\* → [http://localhost:8080/homework](http://localhost:8080/homework)

Can anyone please help us to configure this in our nginx.  
Thanks  
Geo

Posted at Nginx Forum:

> **[Proxypass subfolder entries to another link](https://forum.nginx.org/read.php?2,239916,239916#msg-239916)**
>
> Dear Support Currently we have nginx proxypass to tomcat service and is working fine. server { listen 80; server\_name app.geo.com; location / { if (!-e $request\_filename) { rewrite ^/(.\*)$ /index.php?q=$1 last; } }
