阿里雲-nginx配置https

                找了一大堆的百度,各類雜七雜八的寫了一大堆,坑的我呀,受不了。html

  • 進入https://common-buy.aliyun.com/?spm=5176.2020520154.cas.1.5b1e56a7vkx6TB&commodityCode=cas#/buy
    • 買證書,配置綁定域名,這些都比較簡單了
  • https://help.aliyun.com/knowledge_detail/95491.html?spm=5176.2020520154.cas.26.45d3EO0TEO0TqY
    • 配置nginx
  • 接來就是被坑的地方了。。。。犯了一個很低級的錯誤。。。。443端口忘記開放了,在安全組配置千萬別忘記打開
  • nginx的https簡單配置以下
    • # HTTPS server
          #
          server {
         	listen       443 ssl;
              server_name  localhost;
              ssl on;
              root html;
              index index.html index.htm;
              #替換成本身的ssl證書路徑 start
              ssl_certificate   /usr/local/nginx/cert/xxx.pem; 
              ssl_certificate_key  /usr/local/nginx/cert/xxx.key;
              #end
              ssl_session_timeout 5m;
              ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
              ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
              ssl_prefer_server_ciphers on;
              location / {
                  #ip寫本身的
                  proxy_pass http://ip:80;
                  proxy_http_version 1.1;
                  proxy_set_header Upgrade $http_upgrade;
                  proxy_set_header Connection keep-alive;
                  proxy_set_header Host $host;
                  proxy_cache_bypass $http_upgrade;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-Proto  $scheme;
              }
          }
相關文章
相關標籤/搜索