Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup nginx conf #1565

Merged
merged 4 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docker/batch-test.env
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ INTERNETNL_CACHE_RESET_ALLOWLIST=target.test

# allow localhost for healthchecks, the public domain for the app and it's subdomains for connection tests
ALLOWED_HOSTS=127.0.0.1,::1,localhost,.internet.test,internet.test
CSP_DEFAULT_SRC="'self',*.internet.test"

IPV6_TEST_ADDR=fd00:43:1::100
CONN_TEST_DOMAIN=internet.test
Expand Down
1 change: 0 additions & 1 deletion docker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ services:
- CONN_TEST_DOMAIN
- SMTP_EHLO_DOMAIN
- IPV6_TEST_ADDR
- CSP_DEFAULT_SRC
- IPV4_IP_RESOLVER_INTERNAL_VALIDATING
- IPV4_IP_RESOLVER_INTERNAL_PERMISSIVE
- SENTRY_DSN
Expand Down
1 change: 0 additions & 1 deletion docker/defaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ POSTGRES_DB=internetnl_db1

# allow localhost for healthchecks, the public domain for the app and it's subdomains for connection tests
ALLOWED_HOSTS=127.0.0.1,::1,localhost,.internet.nl,internet.nl,host.docker.internal
CSP_DEFAULT_SRC="'self',*.internet.nl"

# to low of an interval burdens the services, to high causes slow compose up/restarts
HEALTHCHECK_INTERVAL=60s
Expand Down
1 change: 0 additions & 1 deletion docker/develop.env
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ INTERNETNL_CACHE_TTL=30

# allow localhost for healthchecks, the public domain for the app and it's subdomains for connection tests
ALLOWED_HOSTS=127.0.0.1,::1,localhost,.internet.test,internet.test,host.docker.internal,host-gateway
CSP_DEFAULT_SRC="'self',*.internet.test"

# domainname used for connection test
CONN_TEST_DOMAIN=internet.test
Expand Down
1 change: 0 additions & 1 deletion docker/host-dist.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ IPV6_IP_PUBLIC=$IPV6_IP_PUBLIC
IPV4_IP_PUBLIC=$IPV4_IP_PUBLIC

ALLOWED_HOSTS=127.0.0.1,::1,localhost,.$INTERNETNL_DOMAINNAME,$INTERNETNL_DOMAINNAME
CSP_DEFAULT_SRC="'self',https://*.$INTERNETNL_DOMAINNAME"

MATOMO_SUBDOMAIN_TRACKING=*.$INTERNETNL_DOMAINNAME

Expand Down
1 change: 0 additions & 1 deletion docker/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ INTERNETNL_CACHE_RESET_ALLOWLIST=target.test

# allow localhost for healthchecks, the public domain for the app and it's subdomains for connection tests
ALLOWED_HOSTS=127.0.0.1,::1,localhost,.internet.test,internet.test
CSP_DEFAULT_SRC="'self',*.internet.test"

IPV6_TEST_ADDR=fd00:43:1::100
CONN_TEST_DOMAIN=internet.test
Expand Down
3 changes: 3 additions & 0 deletions docker/webserver.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ COPY interface/static/favicon.ico /var/www/internet.nl/

COPY docker/webserver/nginx_templates/* /etc/nginx/templates/
COPY docker/webserver/mime.types /etc/nginx/
COPY docker/webserver/http.headers /etc/nginx/
COPY docker/webserver/hsts.header /etc/nginx/
COPY docker/webserver/all.headers /etc/nginx/
3 changes: 2 additions & 1 deletion docker/webserver/10-variables.envsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# split comma separated list into space separated
export REDIRECT_DOMAINS_LIST=$(echo $REDIRECT_DOMAINS | sed 's/,/ /')

export LANGUAGES_REGEX=$(echo $LANGUAGES | tr ',' '|')
export LANGUAGES_REGEX=$(echo $LANGUAGES | sed -r ';s/,/\\.|/g;s/$/\\./')
export INTERNETNL_DOMAINNAME_REGEX=$(echo $INTERNETNL_DOMAINNAME | sed 's/\./\\./g')
3 changes: 3 additions & 0 deletions docker/webserver/all.headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include http.headers;
include hsts.header;
include conf.d/csp.header;
4 changes: 4 additions & 0 deletions docker/webserver/hsts.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Do *not* add includeSubdomains before https://github.com/internetstandards/Internet.nl/issues/324 is resolved,
# adding includeSubdomains without adding the wildcard SSL certificates will otherwise break the connection test.
add_header 'Strict-Transport-Security' 'max-age=31536000;' always;

7 changes: 7 additions & 0 deletions docker/webserver/http.headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# default headers added to all responses
add_header 'X-Frame-Options' 'SAMEORIGIN' always;
add_header 'X-Content-Type-Options' 'nosniff' always;
add_header 'X-Clacks-Overhead' 'GNU Terry Pratchett' always;
add_header 'Referrer-Policy' 'same-origin' always;
add_header 'X-XSS-Protection' '1; mode=block' always;

Loading
Loading