Files
crank/apps/ui/nginx.conf
T
bsodfather 46892ee61c
CI / Rust Checks (push) Successful in 5m14s
CI / UI Checks (push) Successful in 4s
CI / Deployment Manifests (push) Successful in 2s
CI / Frontend E2E (push) Successful in 2m58s
CI / Deploy (push) Successful in 1m44s
Усилить безопасность веб-интерфейса
2026-07-11 17:12:50 +03:00

131 lines
3.1 KiB
Nginx Configuration File

server {
listen 3000;
server_name _;
absolute_redirect off;
root /usr/share/nginx/html;
index index.html;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self' data: blob:; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'self'" always;
location = / {
try_files /index.html =404;
}
location = /index.html {
return 302 /;
}
location /api/ {
proxy_pass http://admin-api:3001;
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;
}
location /mcp/ {
proxy_pass http://mcp-server:3002/;
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;
}
location = /login {
try_files /html/login.html =404;
}
location = /agents {
try_files /html/agents.html =404;
}
location = /api-keys {
try_files /html/api-keys.html =404;
}
location = /secrets {
try_files /html/secrets.html =404;
}
location = /logs {
try_files /html/logs.html =404;
}
location = /usage {
try_files /html/usage.html =404;
}
location = /settings {
try_files /html/settings.html =404;
}
location = /workspace-setup {
try_files /html/workspace-setup.html =404;
}
location = /wizard {
return 302 /wizard/;
}
location = /wizard/ {
try_files /html/wizard/index.html =404;
}
location ~ ^/wizard/(.+)$ {
rewrite ^/wizard/(.+)$ /html/wizard/$1 break;
try_files $uri =404;
}
location = /html/login.html {
return 302 /login;
}
location = /html/agents.html {
return 302 /agents;
}
location = /html/api-keys.html {
return 302 /api-keys;
}
location = /html/secrets.html {
return 302 /secrets;
}
location = /html/logs.html {
return 302 /logs;
}
location = /html/usage.html {
return 302 /usage;
}
location = /html/settings.html {
return 302 /settings;
}
location = /html/workspace-setup.html {
return 302 /workspace-setup$is_args$args;
}
location = /html/wizard/ {
return 302 /wizard/$is_args$args;
}
location = /html/wizard/index.html {
return 302 /wizard/;
}
location / {
try_files $uri $uri/ /index.html;
}
}