diff --git a/docker-compose.https.yml b/docker-compose.https.yml index 6abc6ec..4ed824f 100644 --- a/docker-compose.https.yml +++ b/docker-compose.https.yml @@ -5,7 +5,7 @@ services: restart: unless-stopped volumes: - ssl_data:/etc/resty-auto-ssl - - ./mod/https/site.conf:/etc/nginx/conf.d/bbb-docker.conf + - ./mod/https/${HTTPS_SITE_FILE}:/etc/nginx/conf.d/bbb-docker.conf environment: ALLOWED_DOMAINS: ${CERTIFICATE_DOMAINS} network_mode: host diff --git a/mod/https/site-ipv4only.conf b/mod/https/site-ipv4only.conf new file mode 100644 index 0000000..4c335e1 --- /dev/null +++ b/mod/https/site-ipv4only.conf @@ -0,0 +1,23 @@ +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +server { + listen 443 ssl http2 default_server; + server_name _; + + include resty-server-https.conf; + + location / { + proxy_http_version 1.1; + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_cache_bypass $http_upgrade; + } +} diff --git a/scripts/compose b/scripts/compose index f246ac2..7d9d785 100755 --- a/scripts/compose +++ b/scripts/compose @@ -22,12 +22,18 @@ if [ -z "$EXTERNAL_IPv4" ]; then exit 1 fi +# set conditional variables export CERTIFICATE_DOMAINS=$DOMAIN export GREENLIGHT_ENDPOINT=https://$DOMAIN/bigbluebutton/api/ if [ "$DEV_MODE" == true ]; then export CERTIFICATE_DOMAINS="invalid" export GREENLIGHT_ENDPOINT=http://10.7.7.1:8080/bigbluebutton/api/ fi +if [ ! -z "$EXTERNAL_IPv6" ]; then + export HTTPS_SITE_FILE="site.conf" +else + export HTTPS_SITE_FILE="site-ipv4only.conf" +fi # concatenate docker-compose file COMPOSE_FILES="-f docker-compose.yml"