ci: docker_tag=dev-test chore(nginx): découpe par routes de ngnix_dev4.4nkweb.com-https.conf avec includes; ajout exceptions .gitignore
This commit is contained in:
parent
f75e45103d
commit
57d47815f9
@ -1,13 +1,13 @@
|
||||
# PROTECTION COMPLÈTE - Empêcher l'accès Cursor à storage/
|
||||
storage/
|
||||
# storage/
|
||||
|
||||
# Variables d'environnement (protection renforcée)
|
||||
*/.env
|
||||
*/.env*
|
||||
*/.toml
|
||||
*/.toml*
|
||||
*/.conf
|
||||
*/.conf*
|
||||
# */.conf
|
||||
# */.conf*
|
||||
|
||||
# Clés utilisateur et données sensibles
|
||||
**/_keys/
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -76,6 +76,8 @@ storage/
|
||||
!storage/*/README.md
|
||||
!storage/*/bitcoin/
|
||||
!storage/*/bitcoin/*.conf
|
||||
!storage/*/nginx/
|
||||
!storage/*/nginx/*.conf
|
||||
|
||||
# Clés utilisateur (double protection)
|
||||
storage/*/_keys/
|
||||
|
15
storage/dev/nginx/ngnix_dev4.4nkweb.com-http.conf
Normal file
15
storage/dev/nginx/ngnix_dev4.4nkweb.com-http.conf
Normal file
@ -0,0 +1,15 @@
|
||||
# HTTP server for ACME and redirect to HTTPS
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
|
||||
# ACME HTTP-01 challenges
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/letsencrypt;
|
||||
}
|
||||
|
||||
# Redirection vers HTTPS pour toutes les autres requêtes
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
}
|
56
storage/dev/nginx/ngnix_dev4.4nkweb.com-https.conf
Normal file
56
storage/dev/nginx/ngnix_dev4.4nkweb.com-https.conf
Normal file
@ -0,0 +1,56 @@
|
||||
# Configuration HTTPS pour $HOST
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name $HOST;
|
||||
|
||||
# Certificats SSL
|
||||
ssl_certificate $CERT_PATH/fullchain.pem;
|
||||
ssl_certificate_key $CERT_PATH/privkey.pem;
|
||||
|
||||
# Configuration SSL
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
|
||||
# Headers de sécurité
|
||||
add_header Strict-Transport-Security "max-age=63072000" always;
|
||||
add_header X-Frame-Options DENY always;
|
||||
add_header X-Content-Type-Options nosniff always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
|
||||
# Grafana - Interface de monitoring (DOIT être avant location /)
|
||||
include $NGINX_CONF_DIR/route_grafana.conf;
|
||||
|
||||
# Loki API - API de logs (DOIT être avant location /)
|
||||
include $NGINX_CONF_DIR/route_loki.conf;
|
||||
|
||||
# Page de statut des services (DOIT être avant location /)
|
||||
include $NGINX_CONF_DIR/route_status.conf;
|
||||
include $NGINX_CONF_DIR/route_status_redirect.conf;
|
||||
include $NGINX_CONF_DIR/route_status_api.conf;
|
||||
|
||||
# API backend - route /back/ vers /api/ du backend
|
||||
include $NGINX_CONF_DIR/route_back_proxy.conf;
|
||||
|
||||
# WebSocket relay (sdk_relay)
|
||||
include $NGINX_CONF_DIR/route_ws.conf;
|
||||
|
||||
# favicon
|
||||
include $NGINX_CONF_DIR/route_favicon.conf;
|
||||
|
||||
# blindbit
|
||||
include $NGINX_CONF_DIR/route_blindbit.conf;
|
||||
|
||||
# lecoffre-front - Application LeCoffre
|
||||
include $NGINX_CONF_DIR/route_lecoffre_redirect.conf;
|
||||
include $NGINX_CONF_DIR/route_lecoffre.conf;
|
||||
include $NGINX_CONF_DIR/route_lecoffre_hmr.conf;
|
||||
include $NGINX_CONF_DIR/route_next_assets.conf;
|
||||
|
||||
# ihm_client (root) - DOIT être en dernier
|
||||
|
||||
include $NGINX_CONF_DIR/route_ihm_client.conf;
|
||||
}
|
8
storage/dev/nginx/route_blindbit.conf
Normal file
8
storage/dev/nginx/route_blindbit.conf
Normal file
@ -0,0 +1,8 @@
|
||||
location $URL_ROUTE_BLINDBIT/ {
|
||||
proxy_pass http://localhost:$BLINDBIT_PORT/;
|
||||
proxy_set_header Host $http_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;
|
||||
|
||||
}
|
4
storage/dev/nginx/route_favicon.conf
Normal file
4
storage/dev/nginx/route_favicon.conf
Normal file
@ -0,0 +1,4 @@
|
||||
location = /favicon.ico {
|
||||
root $NGINX_CONF_DIR/assets;
|
||||
try_files /favicon.ico =404;
|
||||
}
|
24
storage/dev/nginx/route_grafana.conf
Normal file
24
storage/dev/nginx/route_grafana.conf
Normal file
@ -0,0 +1,24 @@
|
||||
location $URL_ROUTE_GRAFAN/ {
|
||||
proxy_pass http://localhost:$GRAFANA_PORT/;
|
||||
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;
|
||||
|
||||
# Configuration spécifique pour Grafana
|
||||
proxy_set_header X-Grafana-Org-Id 1;
|
||||
|
||||
# Support des WebSockets pour les live updates
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
# Timeouts
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
proxy_read_timeout 60s;
|
||||
|
||||
# Buffer settings
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
}
|
11
storage/dev/nginx/route_ihm_client.conf
Normal file
11
storage/dev/nginx/route_ihm_client.conf
Normal file
@ -0,0 +1,11 @@
|
||||
location $URL_ROUTE_IHM_CLIENT {
|
||||
proxy_pass http://localhost:$IHM_CLIENT_PORT;
|
||||
proxy_set_header Host $http_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_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_read_timeout 300;
|
||||
}
|
24
storage/dev/nginx/route_lecoffre.conf
Normal file
24
storage/dev/nginx/route_lecoffre.conf
Normal file
@ -0,0 +1,24 @@
|
||||
location ^~ $URL_ROUTE_LECOFFRE_FRONT/ {
|
||||
# ensure no redirect here; only proxy to Next
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0" always;
|
||||
add_header Pragma "no-cache" always;
|
||||
add_header Expires "-1" always;
|
||||
proxy_hide_header ETag;
|
||||
proxy_hide_header Last-Modified;
|
||||
rewrite ^$URL_ROUTE_LECOFFRE_FRONT/(.*)$ /$1 break;
|
||||
proxy_pass http://localhost:$LECOFFRE_FRONT_PORT;
|
||||
proxy_set_header Host $http_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_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header X-Request-ID $x_request_id;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_read_timeout 300;
|
||||
proxy_send_timeout 300;
|
||||
proxy_connect_timeout 300;
|
||||
}
|
11
storage/dev/nginx/route_lecoffre_hmr.conf
Normal file
11
storage/dev/nginx/route_lecoffre_hmr.conf
Normal file
@ -0,0 +1,11 @@
|
||||
location ^~ $URL_ROUTE_LECOFFRE_FRONT_HMR/ {
|
||||
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_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
rewrite ^$URL_ROUTE_LECOFFRE_FRONT_HMR/(.*)$ $URL_ROUTE_LECOFFRE_FRONT/$1 break;
|
||||
proxy_pass http://localhost:$LECOFFRE_FRONT_PORT;
|
||||
}
|
1
storage/dev/nginx/route_lecoffre_redirect.conf
Normal file
1
storage/dev/nginx/route_lecoffre_redirect.conf
Normal file
@ -0,0 +1 @@
|
||||
location = $URL_ROUTE_LECOFFRE_FRONT { return 301 $URL_ROUTE_LECOFFRE_FRONT/; }
|
15
storage/dev/nginx/route_loki.conf
Normal file
15
storage/dev/nginx/route_loki.conf
Normal file
@ -0,0 +1,15 @@
|
||||
location /loki/ {
|
||||
proxy_pass http://localhost:$LOKI_PORT/;
|
||||
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;
|
||||
|
||||
# CORS pour les requêtes depuis Grafana
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
|
||||
add_header Access-Control-Allow-Headers "Content-Type, Authorization";
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 204;
|
||||
}
|
12
storage/dev/nginx/route_next_assets.conf
Normal file
12
storage/dev/nginx/route_next_assets.conf
Normal file
@ -0,0 +1,12 @@
|
||||
location ^~ $URL_ROUTE_NEXT/ {
|
||||
proxy_pass http://localhost:$LECOFFRE_FRONT_PORT$URL_ROUTE_NEXT/;
|
||||
proxy_set_header Host $http_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_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_read_timeout 300;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
21
storage/dev/nginx/route_status.conf
Normal file
21
storage/dev/nginx/route_status.conf
Normal file
@ -0,0 +1,21 @@
|
||||
location $URL_ROUTE_STATUS_API/ {
|
||||
proxy_pass http://localhost:$STATUS_API_PORT;
|
||||
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;
|
||||
|
||||
# CORS pour les requêtes AJAX
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
|
||||
add_header Access-Control-Allow-Headers "Content-Type, Authorization";
|
||||
|
||||
# Timeouts
|
||||
proxy_connect_timeout 10s;
|
||||
proxy_send_timeout 10s;
|
||||
proxy_read_timeout 10s;
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 204;
|
||||
}
|
||||
}
|
21
storage/dev/nginx/route_status_api.conf
Normal file
21
storage/dev/nginx/route_status_api.conf
Normal file
@ -0,0 +1,21 @@
|
||||
location $URL_ROUTE_STATUS {
|
||||
proxy_pass http://localhost:3006/api;
|
||||
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;
|
||||
|
||||
# CORS pour les requêtes AJAX
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
|
||||
add_header Access-Control-Allow-Headers "Content-Type, Authorization";
|
||||
|
||||
# Timeouts
|
||||
proxy_connect_timeout 10s;
|
||||
proxy_send_timeout 10s;
|
||||
proxy_read_timeout 10s;
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 204;
|
||||
}
|
||||
}
|
4
storage/dev/nginx/route_status_redirect.conf
Normal file
4
storage/dev/nginx/route_status_redirect.conf
Normal file
@ -0,0 +1,4 @@
|
||||
location $URL_ROUTE_STATUS {
|
||||
# Redirection vers $URL_ROUTE_STATUS/
|
||||
return 301 $URL_ROUTE_STATUS/;
|
||||
}
|
15
storage/dev/nginx/route_ws.conf
Normal file
15
storage/dev/nginx/route_ws.conf
Normal file
@ -0,0 +1,15 @@
|
||||
location /ws/ {
|
||||
proxy_pass http://localhost:$SIGNER_PORT/;
|
||||
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
|
||||
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
|
||||
proxy_set_header Sec-WebSocket-Protocol $http_sec_websocket_protocol;
|
||||
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
|
||||
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_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_read_timeout 86400;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user