(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
hostsfile, like127.0.0.1 example.com(in Windows, run alsoipconfig /flushdnsin 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
dockerthen 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.comdomain, withincludingthose ssl files. -
If you use docker, then you can use the above
docker-compose.yaml, relative to that file location create./nginx/conffolder and placesample.conf, and create./nginx/certsfolder and place the generated cert files. -
Use
docker compose up& openhttps://example.com(you can "bypass" warning to open site).