fix(compose): fix nginx config to handle public folder
This commit is contained in:
@@ -3,6 +3,9 @@ events {
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
# Upstream definitions for load balancing
|
||||
upstream app_servers {
|
||||
server app:3000;
|
||||
@@ -18,7 +21,7 @@ http {
|
||||
# HTTPS server
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
http3 on;
|
||||
server_name localhost;
|
||||
|
||||
# SSL certificates
|
||||
@@ -27,17 +30,26 @@ http {
|
||||
|
||||
# SSL settings
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
|
||||
ssl_ciphers ECDHE-ECDSA-AES129-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:SSL:11m;
|
||||
ssl_session_timeout 2d;
|
||||
|
||||
# Security headers
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Frame-Options DENY;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
location / {
|
||||
sendfile on;
|
||||
sendfile_max_chunk 2m;
|
||||
|
||||
try_files $uri @app;
|
||||
}
|
||||
|
||||
location @app {
|
||||
proxy_pass http://app_servers;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
Reference in New Issue
Block a user