feat(deploy): add secure production deployment configuration (Nginx, Docker Compose)
This commit is contained in:
1 parent
d559f00b8a
commit
c99ff191c1
3 files changed
+114
No files matched your search
@@ -0,0 +1,31 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _; # Accept any domain name (or we can specify the demoplace domain later)
|
||||
|
||||
server_tokens off; # Hide NGINX version
|
||||
|
||||
# Security Headers
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
||||
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline' 'unsafe-eval';" always;
|
||||
|
||||
# Rate Limiting zone configuration should be in nginx.conf (http block), but we can configure basic protection
|
||||
# We will pass everything to the frontend container
|
||||
|
||||
location / {
|
||||
proxy_pass http://frontend:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
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;
|
||||
|
||||
# Hide internal technologies from being sent back to the client
|
||||
proxy_hide_header X-Powered-By;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user