直接上配置实例
upstream 域名{
server 127.0.0.1:3002;
}
server {
listen 80;
server_name ‘域名’;
return 301 https://$host$request_uri;
# location /{
# proxy_pass ;
# }
}
server {
listen 443;
server_name 域名;
ssl on;
ssl_certificate cert/star_capillarytech-cn_com.pem;
ssl_certificate_key cert/star_capillarytech-cn_com.key;
location / {
proxy_pass ‘域名’;
}
}
1、注意事项。端口号必须一致
2、443是配置https的
网友评论