ipv6: disable IPv6 if no IP is set

This commit is contained in:
chandi 2020-07-30 12:12:36 +02:00
parent d123b163e6
commit 8956a60b3b
3 changed files with 30 additions and 1 deletions

View File

@ -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

View File

@ -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;
}
}

View File

@ -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"