2014-10-28 81 views
0

我已閱讀this tutorial爲我的laravel網站設置SSL。我沒有閱讀所有內容(oops),也沒有刪除「默認」網站。我從默認站點生成了CSR(但使用example.com作爲域)。現在,我有我的證書,我已經通過laravel鍛造安裝了它,但它不工作:默認網站SSL laravel僞造

這裏是我的/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; 
    } 
} 

我能做些什麼才能使它工作?

回答

0

好的,這是一個證書問題。我試過nginx -t,出現錯誤,現在我重新啓動了所有進程,現在一切都正常。