37 lines
1.2 KiB
Nginx Configuration File
37 lines
1.2 KiB
Nginx Configuration File
map $http_upgrade $xhchat_connection {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
server_tokens off;
|
|
access_log off;
|
|
client_max_body_size 8k;
|
|
|
|
location = /api/v1/inbox {
|
|
client_max_body_size 96k;
|
|
proxy_pass http://api:8080;
|
|
proxy_set_header Host $http_host;
|
|
}
|
|
|
|
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; connect-src 'self'; form-action 'self'; base-uri 'none'; frame-ancestors 'none'" always;
|
|
add_header Referrer-Policy no-referrer always;
|
|
add_header X-Content-Type-Options nosniff always;
|
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
|
|
|
location /api/ {
|
|
proxy_pass http://api:8080;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $xhchat_connection;
|
|
proxy_read_timeout 90s;
|
|
}
|
|
location = /healthz { proxy_pass http://api:8080; }
|
|
location = /readyz { proxy_pass http://api:8080; }
|
|
location / { try_files $uri $uri/ =404; }
|
|
}
|