SSL laravel在默认站点中伪造 [英] SSL laravel forge in default site
问题描述
我已阅读本教程进行设置我的laravel网站的SSL.我没有阅读所有内容(糟糕),也没有删除默认"网站.我已经从默认站点生成了CSR(但对于example.com是域).现在我有了我的证书,并且已经通过laravel forge安装了它,但是它不起作用:
I have read this tutorial to set up SSL for my laravel site. I did not read everything (oops), and did not delete the "default" site. I have generated CSR from default site (but with example.com for domain). Now I have my certificate and i have installed it through laravel forge, but it does not work:
- 无法连接到 https://example.com (浏览器/curl)
- http://example.com 不会重定向到https
-
/var/log/nginx/default-error.log
中没有任何内容
- 我重新启动了nginx
- cannot connect to https://example.com (browser / curl)
- http://example.com does not redirect to https
- Nothing in
/var/log/nginx/default-error.log
- I restarted nginx
这是我的/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;
}
}
我该怎么做才能使其正常工作?
What can I do to make it work ?
推荐答案
好的,这是证书问题.我尝试了nginx -t
,但出现了错误,现在我重新启动了所有过程,现在一切都很好.
Ok, it was a certificate problem. I tried nginx -t
and there was an error, now I restarted all the process and everything is alright now.
这篇关于SSL laravel在默认站点中伪造的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!