如果一站点既要80 http访问,又要443https访问。
要让https和http并存,不能在配置文件中使用ssl on,配置listen 443 ssl;
实例
server
{
listen 80;
listen 443 ssl;
server_name www.iamle.com;
index index.html index.htm index.php;
root /home/wwwroot/www.iamle.com/;
#ssl on; 这里要注释掉
ssl_certificate /usr/local/nginx/conf/www_iamle_com.crt;
ssl_certificate_key /usr/local/nginx/conf/www_iamle_com.key;
#以下配置省略
}
转自:http://www.iamle.com/archives/1231.html
http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server
以上就介绍了Nginx一个server主机上80、433http、https共存,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号