# Proxy Pass

**URL:** <https://www.ruby-forum.com/t/proxy-pass/225070>\
**Category:** NGINX\
**Created:** [December 11, 2012, 3:48am UTC](https://www.ruby-forum.com/t/proxy-pass/225070 "2012-12-11T03:48:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [December 11, 2012, 3:48am UTC](https://www.ruby-forum.com/t/proxy-pass/225070/1 "2012-12-11T03:48:44Z")

</div>

I’m attempting to use the proxy pass directive to send traffic to a  
non-https Apache server on the same server as Nginx. The server is  
behind a  
firewall, and I’m using a port forward to send traffic from a custom  
port  
to the https port. We’ll call that custom port 9000. My location block  
looks like this:

server {  
listen 443  
server\_name \_;

```
ssl on;
ssl_certificate /etc/nginx/certs/company.com.crt;
ssl_certificate_key /etc/nginx/certs/company.com.key;

ssl_session_timeout 5m;

ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers 

```

ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;  
ssl\_prefer\_server\_ciphers on;  
ssl\_verify\_depth 2;

```
location /location {
    proxy_pass http://127.0.0.1:80;
}

```

}

My problem is that when the URI sent to Nginx by the browser is  
[https://blah.company.com:9000/location](https://blah.company.com:9000/location) Nginx translates the URL to  
[https://blah.company.com/location](https://blah.company.com/location) (dropping the port). But, if the URI  
sent  
to Nginx is [https://blah.company.com:9000/location/](https://blah.company.com:9000/location/) (with a trailing  
slash), Nginx translates the URI to  
[https://blah.company.com:9000/location/#](https://blah.company.com:9000/location/#).  
I want the second result, but I don’t want the user to always have to  
type  
the trailing slash. I’ve used Nginx for this purpose before, with the  
same  
configuration, but have not run into this.

-Gabriel
