Welcome! Log In Create A New Profile

Advanced

Nginx-same domain different ports

Posted by djrm 
Nginx-same domain different ports
October 21, 2017 02:57PM
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!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 143
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