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

Re: Nginx default_server catches all. Why?

$
0
0
I mixed up an xxxx and a yyyy when replacing the real addresses by fake ones. The configuration should read:


# default server for this IP
server{
listen xx.xx.xx.xx:8443 default_server;
server_name _;
return 404;
}

server{
listen xx.xx.xx.xx:8443;
server_name *.staging1.yyyy.com staging1.yyyy.com;

ssl on;
ssl_certificate /etc/letsencrypt/live/mindbelts.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mindbelts.com/privkey.pem;

location / {
proxy_pass http://127.0.0.1:6981;
proxy_set_header Host $host;
}
}


server{
listen xx.xx.xx.xx:8443;
server_name *.staging2.yyyy.com .staging2.yyyy.com

ssl on;
ssl_certificate /etc/letsencrypt/live/mindbelts.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mindbelts.com/privkey.pem;

location / {
proxy_pass http://127.0.0.1:6982;
proxy_set_header Host $host;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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