Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
pnm-public
camino
Commits
7e0dc206
Unverified
Commit
7e0dc206
authored
1 year ago
by
vmaubert
Browse files
Options
Downloads
Patches
Plain Diff
fix(nginx): corrige les CSP
parent
f4bdf494
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile.ui
+2
-1
2 additions, 1 deletion
Dockerfile.ui
ui_nginx.conf
+7
-6
7 additions, 6 deletions
ui_nginx.conf
ui_nginx_headers.conf
+6
-0
6 additions, 0 deletions
ui_nginx_headers.conf
with
15 additions
and
7 deletions
Dockerfile.ui
+
2
−
1
View file @
7e0dc206
...
...
@@ -16,5 +16,6 @@ COPY ./ /app/
RUN make build/ui
FROM nginx:1.25.3
ADD ui_nginx.conf /etc/nginx/templates/default.conf.template
COPY ui_nginx.conf /etc/nginx/templates/default.conf.template
COPY ui_nginx_headers.conf /etc/nginx/templates/headers.conf.template
COPY --from=build-stage /app/packages/ui/dist /usr/share/nginx/html
This diff is collapsed.
Click to expand it.
ui_nginx.conf
+
7
−
6
View file @
7e0dc206
...
...
@@ -6,8 +6,11 @@ server {
gzip
on
;
gzip_types
text
/
plain
text
/
css
application
/
json
application
/
javascript
application
/
x
-
javascript
text
/
xml
application
/
xml
application
/
rss
+
xml
text
/
javascript
application
/
vnd
.
ms
-
fontobject
application
/
x
-
font
-
ttf
font
/
opentype
image
/
jpeg
image
/
png
image
/
svg
+
xml
image
/
x
-
icon
;
include
/
etc
/
nginx
/
conf
.
d
/
headers
.
conf
;
location
=/ {
root
/
usr
/
share
/
nginx
/
html
;
include
/
etc
/
nginx
/
conf
.
d
/
headers
.
conf
;
add_header
Cache
-
Control
no
-
cache
;
expires
0
;
try_files
/
index
.
html
=
404
;
...
...
@@ -21,19 +24,15 @@ server {
location
@
index
{
root
/
usr
/
share
/
nginx
/
html
;
include
/
etc
/
nginx
/
conf
.
d
/
headers
.
conf
;
add_header
Cache
-
Control
no
-
cache
;
expires
0
;
try_files
/
index
.
html
=
404
;
}
add_header
Content
-
Security
-
Policy
"default-src 'none'; script-src 'self' ${API_MATOMO_URL} 'sha256-quOgp+M4pH4TUco5DwHuTMyTY9AY+DOk4jkIMuGgSJs='; style-src 'self'; font-src 'self'; object-src 'self'; frame-src 'self'; connect-src 'self' sentry.incubateur.net ${API_MATOMO_URL}; img-src data: 'self' tile.openstreetmap.org a.tile.openstreetmap.org b.tile.openstreetmap.org c.tile.openstreetmap.org tile.openstreetmap.fr a.tile.openstreetmap.fr b.tile.openstreetmap.fr c.tile.openstreetmap.fr geoservices.brgm.fr wxs.ign.fr datacarto.geoguyane.fr gisdata.cerema.fr services.data.shom.fr; base-uri 'none'; form-action 'self'; frame-ancestors 'none';"
;
add_header
X
-
Frame
-
Options
"DENY"
;
add_header
X
-
Content
-
Type
-
Options
"nosniff"
;
add_header
X
-
XSS
-
Protection
"1; mode=block"
;
add_header
Access
-
Control
-
Allow
-
Origin
"*"
;
add_header
Referrer
-
Policy
"same-origin"
;
location
/
apiUrl
{
include
/
etc
/
nginx
/
conf
.
d
/
headers
.
conf
;
add_header
Cache
-
Control
"no-cache"
;
rewrite
^/
apiUrl
/(.*) /$
1
break
;
proxy_pass
${
API_URL
};
...
...
@@ -41,6 +40,7 @@ server {
location
/
stream
/
version
{
include
/
etc
/
nginx
/
conf
.
d
/
headers
.
conf
;
add_header
Cache
-
Control
"no-cache"
;
proxy_set_header
Connection
''
;
proxy_http_version
1
.
1
;
...
...
@@ -49,6 +49,7 @@ server {
}
location
/
televersement
{
include
/
etc
/
nginx
/
conf
.
d
/
headers
.
conf
;
add_header
Cache
-
Control
"no-cache"
;
proxy_pass
${
API_URL
};
}
...
...
This diff is collapsed.
Click to expand it.
ui_nginx_headers.conf
0 → 100644
+
6
−
0
View file @
7e0dc206
add_header
Content
-
Security
-
Policy
"default-src 'none'; script-src 'self' ${API_MATOMO_URL} 'sha256-quOgp+M4pH4TUco5DwHuTMyTY9AY+DOk4jkIMuGgSJs='; style-src 'self'; font-src 'self'; object-src 'self'; frame-src 'self'; connect-src 'self' sentry.incubateur.net ${API_MATOMO_URL}; img-src data: 'self' tile.openstreetmap.org a.tile.openstreetmap.org b.tile.openstreetmap.org c.tile.openstreetmap.org tile.openstreetmap.fr a.tile.openstreetmap.fr b.tile.openstreetmap.fr c.tile.openstreetmap.fr geoservices.brgm.fr wxs.ign.fr datacarto.geoguyane.fr gisdata.cerema.fr services.data.shom.fr; base-uri 'none'; form-action 'self'; frame-ancestors 'none';"
;
add_header
X
-
Frame
-
Options
"DENY"
;
add_header
X
-
Content
-
Type
-
Options
"nosniff"
;
add_header
X
-
XSS
-
Protection
"1; mode=block"
;
add_header
Access
-
Control
-
Allow
-
Origin
"*"
;
add_header
Referrer
-
Policy
"same-origin"
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment