Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx-same domain different ports

$
0
0
Hi everyone,
I have been playing with Nginx but still unable to see working a "simple" configuration.
I have configured nginx as ssl and for 1 host run perfectly. This is the simple config in available site folder:

server {
listen 443 ssl;
access_log /var/log/nginx/mydomain.com.access.log;
error_log /var/log/nginx/mydomain.com.error.log;
server_name mydomain.com;
location / {
proxy_pass http://192.168.1.1:80/;
proxy_read_timeout 90s;
}
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
}

My problem now is that I would like to add another location, i.e. http://192.168.1.2:80 and not sure how should I do it as the domain and if possible the listen port are the same.
I have been searching but don't see anywhere this configuration an would appreciate if anyone can provide any light on this...

Thanks!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>