diff --git a/deploy/nginx/cshare.conf b/deploy/nginx/cshare.conf new file mode 100644 index 0000000..55225f6 --- /dev/null +++ b/deploy/nginx/cshare.conf @@ -0,0 +1,53 @@ +server { + listen 80; + server_name cshare.app www.cshare.app; + + root /var/www/cshare; + index index.html; + + brotli on; + brotli_static on; + gzip on; + gzip_static on; + gzip_vary on; + gzip_types text/css application/javascript application/json image/svg+xml text/plain font/ttf; + + client_max_body_size 520M; + + location = /index.html { + add_header Cache-Control "no-cache"; + try_files $uri =404; + } + + location /assets/ { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } + + location /fonts/ { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } + + location /api/ { + proxy_pass http://127.0.0.1:4001; + 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 600s; + proxy_send_timeout 600s; + } + + location /health { + proxy_pass http://127.0.0.1:4001; + proxy_http_version 1.1; + proxy_set_header Host $host; + } + + location / { + add_header Cache-Control "no-cache"; + try_files $uri /index.html; + } +}