diff --git a/.env.example b/.env.example index 0444374..d7f3adb 100644 --- a/.env.example +++ b/.env.example @@ -2,4 +2,6 @@ PHP_FPM_PASSWORD=password_for_fpm_status FILEBEAT_SETUP=true|false FILEBEAT_CLOUD_ID= FILEBEAT_CLOUD_AUTH= -FILEBEAT_NGINX_VERSION=latest \ No newline at end of file +FILEBEAT_NGINX_VERSION=latest +HTTP_IPV6=true|false +HTTPS_IPV6=true|false \ No newline at end of file diff --git a/config/include.d/80.conf b/config/include.d/80.conf index 29c3962..83cc5c9 100644 --- a/config/include.d/80.conf +++ b/config/include.d/80.conf @@ -1,4 +1,2 @@ listen 80; -listen [::]:80; - include include.d/letsencrypt.conf; \ No newline at end of file diff --git a/config/include.d/ssl.conf b/config/include.d/ssl.conf index 3b83305..eca251f 100644 --- a/config/include.d/ssl.conf +++ b/config/include.d/ssl.conf @@ -1,5 +1,4 @@ listen 443 ssl http2; -listen [::]:443 ssl http2; http2_push_preload on; diff --git a/sh/98-configure-nginx.sh b/sh/98-configure-nginx.sh index 38f738b..55e8036 100644 --- a/sh/98-configure-nginx.sh +++ b/sh/98-configure-nginx.sh @@ -5,6 +5,7 @@ cp -R ${SRC_TEMPLATES}/. ${SRC_CONFIG} PASTA_NGINX_SITE=${SRC_CONFIG}/site.d; PASTA_NGINX_CONF=${SRC_CONFIG}/conf.d; +PASTA_NGINX_INCLUDE=${SRC_CONFIG}/include.d; if [ -d "/var/nginx/conf.d/" ]; then echo "Copiando config extras..."; @@ -93,5 +94,19 @@ if [ -n "$REALIP_FROM" ]; then echo "set_real_ip_from ${REALIP_FROM};" >> $REALIP_FROM_CONFIG fi +if [ -z "$HTTP_IPV6" ] || [ "$HTTP_IPV6" == "true" ]; then + echo "Habilitando IPV6 do HTTP"; + echo "listen [::]:80;" >> ${PASTA_NGINX_INCLUDE}/80.conf; + + cat ${PASTA_NGINX_INCLUDE}/80.conf; +fi; + +if [ -z "$HTTPS_IPV6" ] || [ "$HTTPS_IPV6" == "true" ]; then + echo "Habilitando IPV6 do HTTPS"; + echo "listen [::]:443 ssl http2;" >> ${PASTA_NGINX_INCLUDE}/ssl.conf; + + cat ${PASTA_NGINX_INCLUDE}/ssl.conf; +fi; + cat ${SRC_CONFIG}/nginx.conf; cat ${PASTA_NGINX_SITE}/default.conf; \ No newline at end of file