Nginx multiple domain names share port 80

Add directly to http{}


server
{
listen 80;
server_name www.gpdj.cn;//Domain name
location / {
#....
proxy_pass http://192.168.10.5:10001/;//Project pointed to by reverse proxy
}
##### other directive
} server { listen 80; listen 443 ssl; server_name qc.taiyu.cn;//domain name ssl on;//enable ssl (if you open the certificate, that is, ssql directly add these three red items, and listen 443 ssl above; ) ssl_certificate 214601302190597.pem;//The private key directory, I put it directly in the conf directory of nginx (the ssl certificate needs to be applied for, generally Alibaba Cloud can apply for it, and download it after the application), you can ssl_certificate_key 214601302190597.key;/ /publickeylocation / { #.... proxy_pass http://185.160.190.245:8763/;//Project pointed to by the reverse proxy } ##### other directive }







 
     







Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324613529&siteId=291194637