diff --git a/.env.example b/.env.example index 28b5e682e..3e6da9fd8 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,7 @@ # Public hostmane WEBGIS_PUBLIC_HOSTNAME=dev.g3wsuite.it +WEBGIS_ADMIN_EMAIL=info@gis3w.it +# WEBGIS_SSL=1 # Shared volume mount (docker internal: shared-volume) # I suggest not to use the /tmp/ folder, /tmp/ folder is cleaned at each reboot diff --git a/README.md b/README.md index 6bda15459..26a777eab 100644 --- a/README.md +++ b/README.md @@ -97,10 +97,9 @@ the conf file will be mounted into docker container at runtime to PGSERVICEFILE To active https with LetsEncrypt just follow the following instructions: -- uncomment ssl section within `config/nginx/nginx.conf` -- update `WEBGIS_PUBLIC_HOSTNAME` environment variable within the `.env` and `config/nginx/nginx.conf` files +- toggle `WEBGIS_SSL` environment variable within your `.env` file - launch `sudo ./run_certbot.sh` -- restart compose: `docker compose down && docker compose up -d` +- restart compose: `docker compose up -d --force-recreate` - make sure the certs are renewed by adding a cron job with `sudo crontab -e` and add the following line: `0 3 * * * //run_certbot.sh` diff --git a/config/nginx/django b/config/nginx/conf/django similarity index 89% rename from config/nginx/django rename to config/nginx/conf/django index 638e5ba8c..2e75f825e 100644 --- a/config/nginx/django +++ b/config/nginx/conf/django @@ -1,6 +1,6 @@ # HTTP reverse proxy server (g3w-suite) server { - include /etc/nginx/conf.d/locations; + include /etc/nginx/conf.d/conf/locations; location / { keepalive_timeout 500; @@ -21,7 +21,7 @@ server { # HTTPS (redirect) server { - include /etc/nginx/conf.d/locations; + include /etc/nginx/conf.d/conf/locations; location / { return 302 http://$host:8080$request_uri; diff --git a/config/nginx/django_ssl b/config/nginx/conf/django_ssl similarity index 79% rename from config/nginx/django_ssl rename to config/nginx/conf/django_ssl index 3bd2c658d..5013b5a3e 100644 --- a/config/nginx/django_ssl +++ b/config/nginx/conf/django_ssl @@ -1,7 +1,7 @@ # HTTPS reverse proxy server (g3w-suite) server { - include /etc/nginx/conf.d/locations; - include /etc/nginx/conf.d/letsencrypt; + include /etc/nginx/conf.d/conf/locations; + include /etc/nginx/conf.d/conf/letsencrypt; location / { proxy_read_timeout 120; @@ -19,7 +19,7 @@ server { # HTTP (redirect) server { - include /etc/nginx/conf.d/locations; + include /etc/nginx/conf.d/conf/locations; location / { return 301 https://$host$request_uri; diff --git a/config/nginx/error_pages b/config/nginx/conf/error_pages similarity index 100% rename from config/nginx/error_pages rename to config/nginx/conf/error_pages diff --git a/config/nginx/letsencrypt b/config/nginx/conf/letsencrypt similarity index 100% rename from config/nginx/letsencrypt rename to config/nginx/conf/letsencrypt diff --git a/config/nginx/locations b/config/nginx/conf/locations similarity index 82% rename from config/nginx/locations rename to config/nginx/conf/locations index 045c83f47..e555b0ced 100644 --- a/config/nginx/locations +++ b/config/nginx/conf/locations @@ -1,4 +1,4 @@ -include /etc/nginx/conf.d/error_pages; +include /etc/nginx/conf.d/conf/error_pages; # Block *.php location ~\.php$ { @@ -27,4 +27,4 @@ location /.well-known/acme-challenge/ { root /var/www; } -server_name $WEBGIS_PUBLIC_HOSTNAME; \ No newline at end of file +server_name $NGINX_SERVER_NAME; \ No newline at end of file diff --git a/config/nginx/html/502.html b/config/nginx/html/502.html index e2391d01d..b9174d9f0 100644 --- a/config/nginx/html/502.html +++ b/config/nginx/html/502.html @@ -183,9 +183,9 @@

Bad Gateway

- +