服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

设置SSL – https工作,http不工作

更新:我find的临时解决scheme是只redirect到https的所有http请求。 我一直在努力在我的网站上设置SSL。 这就像在一个Rails上。 我使用nginx与独angular兽。 我从GoDaddy购买了证书。 然后,我按照本文档的说明进行设置并在/etc/nginx/ssl生成CSR。 然后,我复制了生成的.csr文件的文本,并用它从GoDaddy发出证书。 证书颁发后,我下载了在GoDaddy上生成的密钥包,并遵循本文档中的指示。 然后configuration我的/etc/nginx/sites-enabled/mysite.conf文件: (我在服务器{…}下添加了以下几行 listen 443; ssl on; ssl_certificate /etc/nginx/ssl/mysite.crt; ssl_certificate_key /etc/nginx/ssl/mysite.key; (我更换了listen 80 default; listen 443; ) 然后,我重新启动服务器,并使HTTPS://www.example.com正常工作。 https是绿色的,显示证书没问题。 但是,当我浏览到HTTP://www.example.com我得到一个错误:502错误的网关 – nginx。 我不确定是什么原因造成的。 任何线索? 如果你需要任何其他信息让我知道,我会张贴他们。 我的网站configuration: /etc/nginx/sites-enabled/example.conf upstream example { server unix:/u/app/example/shared/.sock fail_timeout=0; } server { listen 80; server_name www.example.com; root /u/app/example/current/public/; access_log /u/app/example/shared/log/nginx.access.log; error_log /u/app/example/shared/log/nginx.error.log; client_max_body_size 20M; […]