@@ -0,0 +1,55 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html/current;
|
||||
index index.html;
|
||||
|
||||
include /etc/nginx/snippets/security-headers.conf;
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_types text/plain text/css application/javascript application/json image/svg+xml application/manifest+json;
|
||||
|
||||
location = /healthz {
|
||||
access_log off;
|
||||
default_type text/plain;
|
||||
return 200 "ok\n";
|
||||
}
|
||||
|
||||
# L'API. Le resolver Docker est declare pour que le conteneur soit resolu
|
||||
# a la demande : nginx peut demarrer avant l'API, et le front reste servi
|
||||
# pendant un redemarrage de celle-ci.
|
||||
location /api/ {
|
||||
include /etc/nginx/snippets/security-headers.conf;
|
||||
resolver 127.0.0.11 valid=30s ipv6=off;
|
||||
set $cohaise_api http://api:8080;
|
||||
proxy_pass $cohaise_api$request_uri;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 60s;
|
||||
client_max_body_size 1m;
|
||||
}
|
||||
|
||||
location /assets/ {
|
||||
include /etc/nginx/snippets/security-headers.conf;
|
||||
include /etc/nginx/snippets/cache-immutable.conf;
|
||||
expires 1y;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
include /etc/nginx/snippets/security-headers.conf;
|
||||
include /etc/nginx/snippets/cache-no-cache.conf;
|
||||
try_files $uri $uri/ @spa;
|
||||
}
|
||||
|
||||
location @spa {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
add_header Cache-Control "public, immutable" always;
|
||||
@@ -0,0 +1 @@
|
||||
add_header Cache-Control "no-cache" always;
|
||||
@@ -0,0 +1,3 @@
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "DENY" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
@@ -0,0 +1,38 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html/current;
|
||||
index index.html;
|
||||
|
||||
include /etc/nginx/snippets/security-headers.conf;
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_types text/plain text/css application/javascript application/json image/svg+xml application/manifest+json;
|
||||
|
||||
location = /healthz {
|
||||
access_log off;
|
||||
default_type text/plain;
|
||||
return 200 "ok\n";
|
||||
}
|
||||
|
||||
location /assets/ {
|
||||
include /etc/nginx/snippets/security-headers.conf;
|
||||
include /etc/nginx/snippets/cache-immutable.conf;
|
||||
expires 1y;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
include /etc/nginx/snippets/security-headers.conf;
|
||||
include /etc/nginx/snippets/cache-no-cache.conf;
|
||||
try_files $uri $uri/ @spa;
|
||||
}
|
||||
|
||||
location @spa {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user