【发布时间】:2021-07-13 02:16:11
【问题描述】:
我有一个 Laravel 8 应用程序。
我不知道我错过了什么。我正在尝试在我的服务器中部署一个站点。
我不断得到:
无效的 SSL 证书
server {
listen 443;
ssl_certificate /etc/nginx/ssl/mybabies.app.crt;
ssl_certificate_key /etc/nginx/ssl/mybabies.app.key;
server_name mybabies.app www.mybabies.app;
root /home/bheng/mybabies/public;
index index.html index.htm index.php;
charset utf-8;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
client_max_body_size 500M;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log error;
error_page 404 /index.php;
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc|woff2|woff)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location / {
#limit_req zone=one burst=2 nodelay;
try_files $uri $uri/ /index.php?$query_string;
add_header 'Access-Control-Allow-Origin' '*';
}
}
我已经在 CloudFlare 中创建了crt + pem 键并在这两行中进行配置:
ssl_certificate /etc/nginx/ssl/mybabies.app.crt;
ssl_certificate_key /etc/nginx/ssl/mybabies.app.key;
编辑
当我暂停时
当我点击View Certificate 时,我看到了
更新
我从
创建了证书【问题讨论】:
-
可能您在 CloudFlare 上使用
Full (strict)加密,您可以通过在 CloudFlare 的 SSL/TLS 部分更改Flexible模式来解决此问题 -
@EsTeAa 它将禁用 cloudflare 和服务器之间的 SSL。它修复了症状,而不是问题的根源。如果忽略 SSL,则使用 full(不是 full scrict),不灵活。作者也在尝试在服务器上设置正确的证书,所以应该在那里解决问题。
-
@cyber8200 暂时禁用 CF,并检查服务器是否/返回了什么证书
-
@chojnicki :我暂时暂停了 CF。我收到了
NET::ERR_CERT_INVALID- 你可能会看到。 mybabies.app -
@chojnicki :我还能做什么?
标签: laravel nginx cloudflare laravel-8