-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Create a different file to be consumed by `Docker` and `Docker.dev` for nginx deployment. - Moved the `add_header` instructions from "nginx.conf" to "default.conf.dev.template". Both files had the `server` defined and the headers were never added. - The only difference between "default.conf.template" and "default.conf.dev.template" is the `http://localhost:*` defined for the `connect-src`. - The only change from previous configurations was about `Content-Security-Policy` and they are the below. ``` default-src 'self'; connect-src 'self' *.gov.bc.ca; script-src 'self' 'unsafe-eval' https://cdn.form.io/flatpickr/flatpickr.min.js; style-src 'self' 'unsafe-inline' https://stackpath.bootstrapcdn.com/bootstrap/ https://cdn.form.io/flatpickr/flatpickr.min.css; font-src 'self' data:; img-src 'self' data:" ``` - Comments about the above configurations - The list was created to test the web portal. - Some are required because form.io loads external libs like `flatpickr.min.js` on demand. - `*.gov.bc.ca` was added to allow Keycloak access and logout URL for Institutions. ### Minor outside PR scope changes - Moved nginx files to a nginx folder. - Changed the `web-local` make to build to make it easier to test changes on the web app. ### Localhost sample with headers ![image](https://github.com/user-attachments/assets/1154a722-c31a-4b61-9be6-88c0d46cf942)
- Loading branch information
1 parent
fce394c
commit 418219c
Showing
8 changed files
with
72 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# nginx default configuration. | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
server { | ||
# Log to stdout | ||
set $loggable 1; | ||
if ($http_user_agent ~* "^kube-probe/") { | ||
set $loggable 0; | ||
} | ||
access_log /dev/stdout main if=$loggable; | ||
|
||
listen ${PORT}; | ||
location / { | ||
root /opt/app-root/src; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
add_header 'X-Content-Type-Options' "nosniff"; | ||
add_header 'Content-Security-Policy' "default-src 'self'; connect-src 'self' *.gov.bc.ca http://localhost:*; script-src 'self' 'unsafe-eval' https://cdn.form.io/flatpickr/flatpickr.min.js; style-src 'self' 'unsafe-inline' https://stackpath.bootstrapcdn.com/bootstrap/ https://cdn.form.io/flatpickr/flatpickr.min.css; font-src 'self' data:; img-src 'self' data:"; | ||
add_header 'Strict-Transport-Security' "max-age=31536000; includeSubDomains; preload"; | ||
add_header 'Referrer-Policy' "same-origin"; | ||
add_header 'X-Frame-Options' "sameorigin"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# nginx default configuration. | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
server { | ||
# Log to stdout | ||
set $loggable 1; | ||
if ($http_user_agent ~* "^kube-probe/") { | ||
set $loggable 0; | ||
} | ||
access_log /dev/stdout main if=$loggable; | ||
|
||
listen ${PORT}; | ||
location / { | ||
root /opt/app-root/src; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
add_header 'X-Content-Type-Options' "nosniff"; | ||
add_header 'Content-Security-Policy' "default-src 'self'; connect-src 'self' *.gov.bc.ca; script-src 'self' 'unsafe-eval' https://cdn.form.io/flatpickr/flatpickr.min.js; style-src 'self' 'unsafe-inline' https://stackpath.bootstrapcdn.com/bootstrap/ https://cdn.form.io/flatpickr/flatpickr.min.css; font-src 'self' data:; img-src 'self' data:"; | ||
add_header 'Strict-Transport-Security' "max-age=31536000; includeSubDomains; preload"; | ||
add_header 'Referrer-Policy' "same-origin"; | ||
add_header 'X-Frame-Options' "sameorigin"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
worker_processes auto; | ||
|
||
# Log to stdout | ||
error_log /dev/stdout info; | ||
pid /tmp/nginx.pid; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
include /etc/nginx/mime.types; | ||
include /etc/nginx/conf.d/default.conf; | ||
default_type application/octet-stream; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
} |