Nginx一個server主機上80、433,http、https共存


如果一站點既要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/ssl/www_iamle_com.crt;
    ssl_certificate_key /usr/local/nginx/conf/ssl/www_iamle_com.key;

    #以下配置省略...
}

 

相關鏈接 :

  http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server

相關文章:

  http://www.iamle.com/archives/1231.html

  http://www.cnblogs.com/kevingrace/p/6187072.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM