This project leverages NGINX docker image, H5BP configs and Certbot image to provide a plug and play HTTPS static gzipped file server with subdomain capabilities.
You will need a machine with internet connection, Docker, Docker Compose and docker storage base directory properly setted.
Lets say that our root domain is example.com and en.example.com is a subdomain, this configuration redirects:
example.comtowww.example.com.www.en.example.comtoen.example.com.
This configuration redirects HTTP requests to their HTTPS counterpart.
- Folder index is
index.html. - Missing page should be
/thispagedoesntexist.html, otherwise default NGINX 404 page is returned. - An URL without a page extension is valid, for ex.
www.example.com/index
The the domain root is /var/www (in-container folder), the data should follow the structure /var/www/subdomainname/html/subdomaindata, for ex.:
/var/www/
├── en/html/
│ ├── index.html.gz
│ ├── thispagedoesntexist.html.gz
│ ├── loremipsum.html.gz
│ ├── awesome/
│ │ ├── index.html.gz
│ │ │── aprimatesmemoir.html.gz
│ │ └── .../
│ └── .../
├── www/html/
│ ├── index.html.gz
│ ├── thispagedoesntexist.html.gz
│ └── .../
└── .../
curl https://raw.githubusercontent.com/ebonetti/tatic/master/docker-compose.yml | DOMAIN=example.com EMAIL=email@example.com PATH2DATA=/path/2/your/dir docker-compose -f - config | tee docker-compose.ymlDownload and set up your configuration file, setting up the domain asexample.com, the mail (used for HTTPS certificate request) asemail@example.comand setting the website folder to/path/2/your/dir.docker-compose upStart NGINX server and certbot certificate requests.docker-compose up -dStart detatched.docker-compose pullUpdate images to the last revision.docker-compose downStop and remove container and networks.docker-compose logs -fFetch and follow the logs.docker-compose psCheck containers status.docker system prune -fa --volumesRemove system wide all unused images, containers and volumes (with old certificates) without asking for confirmation.