Skip to content

Commit ae6d427

Browse files
committed
🐛 Nginx container fixes: CSP, MIME types, homepage-link, favicon
- CSP: script-src en style-src 'self' 'unsafe-inline' toegevoegd zodat inline scripts en styles niet geblokkeerd worden - CSS/JS location blok verwijderd (vermeed header-inheritance bug en onnodige 1y cache voor PoC) - Font MIME type font/ttf toegevoegd voor .ttf bestanden - Homepage-link van /poc-moza/ naar /moza/ gecorrigeerd - ZAD component hernoemd van 'frontend' naar 'proef' - Favicon alias zodat /favicon.ico naar /assets/favicon/favicon.ico verwijst
1 parent 8c5cce8 commit ae6d427

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
api-key: ${{ secrets.ZAD_API_KEY }}
7878
project-id: pm-5sj
7979
deployment-name: pr${{ github.event.pull_request.number }}
80-
component: frontend
80+
component: proef
8181
image: ${{ needs.build.outputs.image }}
8282
comment-on-pr: true
8383
qr-code: true

.github/workflows/production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868
api-key: ${{ secrets.ZAD_API_KEY }}
6969
project-id: pm-5sj
7070
deployment-name: poc
71-
component: frontend
71+
component: proef
7272
image: ${{ needs.build.outputs.image }}
7373
wait-for-ready: true

_includes/header-overheid.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<header>
22
<figure class="logo">
3-
<a href="/poc-moza/">
3+
<a href="/moza/">
44
<img src="{{ '/assets/images/beeldmerk-rijksoverheid.svg' | url }}" alt="Naar de homepage van MijnOverheid Zakelijk">
55
</a>
66
</figure>

container/default.conf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ server {
1212
add_header X-Frame-Options "SAMEORIGIN" always;
1313
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
1414
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
15-
add_header Content-Security-Policy "default-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'self'; form-action 'none';" always;
15+
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; object-src 'none'; base-uri 'self'; form-action 'none';" always;
1616
add_header Strict-Transport-Security "max-age=31536000" always;
1717

18-
location /.well-known/security.txt {
19-
return 302 https://www.ncsc.nl/.well-known/security.txt;
18+
location = /favicon.ico {
19+
alias /usr/share/nginx/html/assets/favicon/favicon.ico;
2020
}
2121

22-
location ~* \.(css|js)$ {
23-
expires 1y;
24-
add_header Cache-Control "public, immutable";
22+
location /.well-known/security.txt {
23+
return 302 https://www.ncsc.nl/.well-known/security.txt;
2524
}
2625

2726
location / {

container/nginx.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ http {
1515
scgi_temp_path /tmp/scgi_temp;
1616

1717
include /etc/nginx/mime.types;
18+
types {
19+
font/ttf ttf;
20+
}
1821
default_type application/octet-stream;
1922

2023
access_log off;

0 commit comments

Comments
 (0)