nginx怎么配置ssl可以即允许http访问也允许https访问
nginx怎么配置ssl可以即允许http访问也允许https访问
日期:2021-05-04 22:52:50 人气:1
这是个很简单的问题,你只需要同时监听两个端口就可以了:
server
{
listen 80; #允许http访问
listen 443 ssl; #允许https访问
server_name youdomain;
index index.html index.htm index.php;
root /data/web/;
}
server
{
listen 80; #允许http访问
listen 443 ssl; #允许https访问
server_name youdomain;
index index.html index.htm index.php;
root /data/web/;
}