web: add ability to disable IPv6

pull/879/head
karniemi 4 years ago committed by GitHub
parent af6f3ac69d
commit eedac14370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      env.example
  2. 6
      web/rootfs/defaults/default

@ -352,6 +352,10 @@ JIBRI_LOGS_DIR=/config/logs
# Necessary for Let's Encrypt, relies on standard HTTPS port (443) # Necessary for Let's Encrypt, relies on standard HTTPS port (443)
#ENABLE_HTTP_REDIRECT=1 #ENABLE_HTTP_REDIRECT=1
# Enable IPv6
# Provides means to disable IPv6 in environments that don't support it (get with the times, people!)
#ENABLE_IPV6=1
# Container restart policy # Container restart policy
# Defaults to unless-stopped # Defaults to unless-stopped
RESTART_POLICY=unless-stopped RESTART_POLICY=unless-stopped

@ -1,6 +1,9 @@
server { server {
listen 80 default_server; listen 80 default_server;
{{ if .Env.ENABLE_IPV6 | default "1" | toBool }}
listen [::]:80 default_server; listen [::]:80 default_server;
{{ end }}
{{ if .Env.ENABLE_HTTP_REDIRECT | default "0" | toBool }} {{ if .Env.ENABLE_HTTP_REDIRECT | default "0" | toBool }}
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
@ -12,7 +15,10 @@ server {
{{ if not (.Env.DISABLE_HTTPS | default "0" | toBool) }} {{ if not (.Env.DISABLE_HTTPS | default "0" | toBool) }}
server { server {
listen 443 ssl http2; listen 443 ssl http2;
{{ if .Env.ENABLE_IPV6 | default "1" | toBool }}
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
{{ end }}
include /config/nginx/ssl.conf; include /config/nginx/ssl.conf;
include /config/nginx/meet.conf; include /config/nginx/meet.conf;

Loading…
Cancel
Save