SSL certificate on local Laradock Nginx project

前端 未结 1 962
后悔当初
后悔当初 2021-01-21 15:36

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?

1条回答
  •  [愿得一人]
    2021-01-21 16:21

    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;
    

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

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

    0 讨论(0)
提交回复
热议问题