Welcome! Log In Create A New Profile


reverse proxy with TLS termination and DNS lookup

Posted by squonk 
reverse proxy with TLS termination and DNS lookup
September 03, 2016 02:05PM
hi all..

I am trying to configure a reverse proxy which redirects a URL of the form:




with DNS resolution of "myapp" to an IP address at runtime.

My current configuration file is:

listen 80 default_server;
server_name mydomain.com;
return 301 https://www.mydomain.com$request_uri;

listen 443 ssl default_server;
server_name mydomain.com;
<ssl setup.. works ok>;

resolver valid=60s; // DNS name server.. 'nslookup myapp' does work
set app_upstream http://myapp:5100;
location /myapp/ {
rewrite ^/myapp/(.*) /$1 break;
proxy_pass $app_upstream;

When i try:


it resolves to:


but the log shows that the port isn't appended. I would prefer it if the caller didn't have to know the port. I could iterate, but don't have enough experience to say whether the overall approach is consistent with Nginx best practice and i need to proxy servers other than myapp so any feedback would be appreciated.

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 100
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready