0

我已阅读本教程为我的 laravel 站点设置 SSL。我没有阅读所有内容(哎呀),也没有删除“默认”站点。我已经从默认站点生成了 CSR(但使用 example.com 作为域)。现在我有了我的证书,我已经通过 laravel forge 安装了它,但它不起作用:

这是我的/etc/nginx/sites-available/default文件内容:

server {
    listen 80;
    #server_name default;
    server_name example.com www.example.com;
    #return 301 default$request_uri;
    return 301 https://example.com$request_uri;
}

server {
    listen 443 ssl;
    #server_name default;
    server_name example.com www.example.com;
    root /home/forge/default/public;

    # FORGE SSL (DO NOT REMOVE!)
    ssl_certificate /etc/nginx/ssl/default/XXXXX/server.crt;
    ssl_certificate_key /etc/nginx/ssl/default/XXXXX/server.key;

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/default-error.log error;

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

我该怎么做才能让它发挥作用?

4

1 回答 1

0

好的,这是证书问题。我试过nginx -t了,有一个错误,现在我重新启动了所有的过程,现在一切都很好。

于 2014-10-29T16:27:21.867 回答