mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Configures application for production with enhanced security, performance optimizations, and automated deployment scripts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/6e755801-08e8-4492-805e-ac3610de5a2a.jpg
84 lines
2.9 KiB
Plaintext
84 lines
2.9 KiB
Plaintext
# Configuration Nginx pour RegisFlow Production
|
|
# Placez ce fichier dans /etc/nginx/sites-available/regisflow
|
|
# Puis créez un lien : ln -s /etc/nginx/sites-available/regisflow /etc/nginx/sites-enabled/
|
|
|
|
server {
|
|
listen 80;
|
|
server_name votre-domaine.com www.votre-domaine.com;
|
|
|
|
# Redirection automatique vers HTTPS
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name votre-domaine.com www.votre-domaine.com;
|
|
|
|
# Configuration SSL (Let's Encrypt recommandé)
|
|
ssl_certificate /etc/letsencrypt/live/votre-domaine.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/votre-domaine.com/privkey.pem;
|
|
|
|
# Configuration SSL sécurisée
|
|
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;
|
|
ssl_prefer_server_ciphers off;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 10m;
|
|
|
|
# Sécurité headers
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" 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;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self';" always;
|
|
|
|
# Configuration des logs
|
|
access_log /var/log/nginx/regisflow_access.log;
|
|
error_log /var/log/nginx/regisflow_error.log;
|
|
|
|
# Limite de taille des uploads
|
|
client_max_body_size 10M;
|
|
|
|
# Configuration du proxy vers RegisFlow
|
|
location / {
|
|
proxy_pass http://127.0.0.1:5000;
|
|
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;
|
|
proxy_cache_bypass $http_upgrade;
|
|
|
|
# Timeouts
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
# Optimisations pour les fichiers statiques
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
|
proxy_pass http://127.0.0.1:5000;
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Health check
|
|
location /health {
|
|
proxy_pass http://127.0.0.1:5000/health;
|
|
access_log off;
|
|
}
|
|
|
|
# Protection contre les attaques
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
|
|
# Limitation du taux de requêtes
|
|
limit_req_zone $binary_remote_addr zone=regisflow:10m rate=10r/s;
|
|
limit_req zone=regisflow burst=20 nodelay;
|
|
} |