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:<br>
<br>server {<br> listen 443<br> server_name _;<br><br> ssl on;<br> ssl_certificate /etc/nginx/certs/company.com.crt;<br> ssl_certificate_key /etc/nginx/certs/company.com.key;<br>
<br> ssl_session_timeout 5m;<br><br> ssl_protocols SSLv2 SSLv3 TLSv1;<br> ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;<br> ssl_prefer_server_ciphers on;<br> ssl_verify_depth 2;<br>
<br> location /location {<br> proxy_pass <a href="http://127.0.0.1:80">http://127.0.0.1:80</a>;<br> }<br>}<br><br>My problem is that when the URI sent to Nginx by the browser is <a href="https://blah.company.com:9000/location">https://blah.company.com:9000/location</a> Nginx translates the URL to <a href="https://blah.company.com/location">https://blah.company.com/location</a> (dropping the port). But, if the URI sent to Nginx is <a href="https://blah.company.com:9000/location/">https://blah.company.com:9000/location/</a> (with a trailing slash), Nginx translates the URI to <a href="https://blah.company.com:9000/location/#">https://blah.company.com:9000/location/#</a>. 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. <br>
<br>-Gabriel<br>