ssl安装后网站将无法运行

时间:2015-07-02 03:00:29

标签: ssl nginx

在我安装ssl证书之前,我的网站工作正常。但是,一旦安装,我的网站就停止了工作。 Nginx像往常一样开始,我没有错误,但网站不起作用。这是我的nginx配置代码:

server {

listen 80;
server_name www.example.com; (example is replaced with my domain name in code)
location / {
      rewrite ^ https://$server_name$request_uri permanent;
  }
}
server {

listen 443 ssl;
server_name www.example.com;
ssl_certificate /etc/nginx/ssl/example_com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example_com/example.key;
ssl_prefer_server_ciphers on;

location / {

   proxy_pass http://xxx.xx.xx.xxx:8004;

   proxy_http_version 1.1;

   proxy_set_header Upgrade $http_upgrade;

   proxy_set_header Connection 'upgrade';

   proxy_set_header Host $host;

   proxy_cache_bypass $http_upgrade;

}

}

0 个答案:

没有答案