本地Laradock Nginx项目上的SSL证书 [英] SSL certificate on local Laradock Nginx project

查看:83
本文介绍了本地Laradock Nginx项目上的SSL证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要您的帮助,以便在本地计算机上使用Nginx和SSL伪造"证书来设置Laradock(使用Docker).

I need your help to set my Laradock (with Docker) using Nginx and SSL "fake" certificate on my local machine.

我不知道如何设置它.你能帮我吗?

I have no idea how to setup it. Could you please help me?

谢谢

推荐答案

要使用带有自签名证书的laradock当前版本(自2019年11月起)启用SSL,必须在nginx设置中启用SSL.在文件夹nginx/sites内,删除第6行#For https"下的注释:

To enable SSL with the current version of laradock (as of Nov 2019) with a self signed certificate you must enable it in the nginx settings. Inside the folder nginx/sites remove the comments below line 6 "# For https" :

# For https
listen 443 ssl default_server;
listen [::]:443 ssl default_server ipv6only=on;
ssl_certificate /etc/nginx/ssl/default.crt;
ssl_certificate_key /etc/nginx/ssl/default.key;

重新启动nginx: docker-compose重新启动nginx 并且您已经准备好了.

restart nginx : docker-compose restart nginx and you're ready.

如果google-chrome投诉,您可以启用 chrome://flags/#allow-insecure-localhost 处的标志,甚至允许使用无效的证书.

If google-chrome complains you can enable the flag at chrome://flags/#allow-insecure-localhost to allow even invalid certificates.

这篇关于本地Laradock Nginx项目上的SSL证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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