(note, we everywhere use example.com
in these samples, but you should replace it with something other your preferred name)
-
Set virtual host entry in your OS
hosts
file, like127.0.0.1 example.com
(in Windows, run alsoipconfig /flushdns
in powershell) -
Generate local certificate files by running
mkcert
:mkcert "example.com"
or with wildcard & subdomain support:mkcert "*.example.com"
(You can get mkcert very easily: https://github.com/FiloSottile/mkcert#installation ) -
If you use
docker
then jump to 4th line, otherwise if you don't use Docker, then you will need to manually setup things in your local LAMP server make an HTTPS entry (443 port) for thatexample.com
domain, withincluding
those ssl files. -
If you use docker, then you can use the above
docker-compose.yaml
, relative to that file location create./nginx/conf
folder and placesample.conf
, and create./nginx/certs
folder and place the generated cert files. -
Use
docker compose up
& openhttps://example.com
(you can "bypass" warning to open site).