4NK_node/conf/nginx.conf
Debian c45e1c48bc
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 31s
CI - 4NK_node / Unit Tests (push) Failing after 32s
CI - 4NK_node / Integration Tests (push) Failing after 13s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 11s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 29s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
feat(stack): routes Nginx (/secure_id, storage health), RPC creds, relay auth fallback, build fixes
2025-09-02 14:19:42 +00:00

81 lines
2.5 KiB
Nginx Configuration File

# Configuration Nginx Reverse Proxy - Module 4NK_node
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logs centralisés
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# DNS Docker interne
resolver 127.0.0.11 ipv6=off valid=30s;
# HTTP server only (no TLS)
server {
listen 80;
server_name _;
# IHM Client statique sur /secure_id
location /secure_id/ {
alias /usr/share/nginx/html/secure_id/;
try_files $uri $uri/ /secure_id/index.html;
add_header Cache-Control "no-store";
}
# (pas d'API HTTP pour les relays)
# SDK Relay 1 WebSocket
location /ws/relay1/ {
proxy_pass http://4nk-sdk-relay1:8090/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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;
}
# SDK Storage: route vers /health OK (200); racine renvoie 404
set $storage http://4nk-sdk-storage:8081/health;
location /api/storage/ {
proxy_pass $storage;
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;
}
# (pas d'API HTTP pour le signer)
# SDK Signer WebSocket
set $signer_ws http://4nk-sdk-signer:9090;
location /ws/signer/ {
proxy_pass $signer_ws/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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;
}
# Health check endpoint
location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}
}
}