SSL laravel在默认站点中伪造 [英] SSL laravel forge in default site

查看:103
本文介绍了SSL laravel在默认站点中伪造的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读本教程进行设置我的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:

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆