first commit
This commit is contained in:
60
reverse-proxy/default.conf
Normal file
60
reverse-proxy/default.conf
Normal file
@@ -0,0 +1,60 @@
|
||||
upstream frontend_upstream {
|
||||
server frontend:80;
|
||||
keepalive 16;
|
||||
}
|
||||
|
||||
upstream backend_upstream {
|
||||
server backend:8000;
|
||||
keepalive 16;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
server_tokens off;
|
||||
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
|
||||
|
||||
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_set_header Connection "";
|
||||
proxy_read_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
|
||||
location ^~ /api/ {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate" always;
|
||||
proxy_pass http://backend_upstream/api/;
|
||||
}
|
||||
|
||||
location = /docs {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate" always;
|
||||
proxy_pass http://backend_upstream/docs;
|
||||
}
|
||||
|
||||
location = /openapi.json {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate" always;
|
||||
proxy_pass http://backend_upstream/openapi.json;
|
||||
}
|
||||
|
||||
location = /redoc {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate" always;
|
||||
proxy_pass http://backend_upstream/redoc;
|
||||
}
|
||||
|
||||
location ~* \.(?:css|js|mjs|png|jpg|jpeg|gif|svg|ico|webp|woff2?)$ {
|
||||
proxy_pass http://frontend_upstream;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://frontend_upstream;
|
||||
add_header Cache-Control "no-store, no-cache" always;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user