- UX audit Fix 1-5: actionable MCP HandoffSurface (endpoint/discovery/onboarding), reachable approval loop (sidebar section + waiting-for-me badge), honest MCP entry labels, ROUTES SSOT for dashboard-testing/load-testing (+ link-integrity coverage) - scenario registry hub (/dashboard-testing/scenarios) built on ScenarioRegistryModel - admin MCP governance: read-only GET /api/admin/mcp/catalog (catalog x roles + DCR clients) + /admin/mcp page/model/api + ROUTES.admin.mcp + sidebar entry - full i18n sweep of dashboard-testing routes and scenario-* component trees (ru/en) - accumulated workspace: MCP OAuth/DCR, automation idempotency migration, docker/nginx, specs
110 lines
4.2 KiB
Plaintext
110 lines
4.2 KiB
Plaintext
# #region docker.nginx.ssl.conf [C:3] [TYPE Module] [SEMANTICS nginx,ssl,https,enterprise]
|
||
# @BRIEF Nginx config с опциональным SSL — HTTP (порт 80) + HTTPS (порт 443), JSON access logs and trace forwarding.
|
||
# Используется frontend.entrypoint.sh, если найдены server.crt + server.key.
|
||
# @PRE SSL сертификаты: /etc/nginx/ssl/server.crt и /etc/nginx/ssl/server.key.
|
||
# Внутренний Docker DNS: backend:8000 для API/WS прокси.
|
||
# @POST HTTP (80) редиректит на HTTPS (443) если SSL включён.
|
||
# Proxy access records are JSON on stdout and include client X-Trace-ID/timings.
|
||
# HTTPS (443) сервит статику + прокси /api/ и /ws/ на backend.
|
||
# @LAYER Infrastructure
|
||
# @RELATION DEPENDS_ON -> [docker/frontend.entrypoint.sh]
|
||
# @RELATION DEPENDS_ON -> [docker/nginx.conf]
|
||
# @INVARIANT Порт 80 всегда открыт (fallback для HTTP-only окружений).
|
||
# @INVARIANT /api/ и /ws/ проксируются на http://backend:8000 (без TLS внутри compose-сети),
|
||
# preserving Authorization and X-Trace-ID headers.
|
||
# @RATIONALE stdout JSON logs survive container log aggregation and make nginx/backend event correlation queryable.
|
||
# @REJECTED Прокси на HTTPS внутри compose-сети отвергнут — избыточно.
|
||
|
||
map $http_upgrade $connection_upgrade {
|
||
default upgrade;
|
||
'' close;
|
||
}
|
||
|
||
# Keep TLS deployment observability identical to HTTP-only deployment.
|
||
log_format observability_json escape=json '{'
|
||
'"ts":"$time_iso8601",'
|
||
'"trace_id":"$http_x_trace_id",'
|
||
'"request_id":"$request_id",'
|
||
'"remote_addr":"$remote_addr",'
|
||
'"method":"$request_method",'
|
||
'"uri":"$uri",'
|
||
'"status":$status,'
|
||
'"upstream_status":"$upstream_status",'
|
||
'"request_time":$request_time,'
|
||
'"upstream_response_time":"$upstream_response_time"'
|
||
'}';
|
||
|
||
access_log /dev/stdout observability_json;
|
||
error_log /dev/stderr warn;
|
||
|
||
server {
|
||
listen 80 default_server;
|
||
server_name _;
|
||
|
||
# Редирект на HTTPS если сертификаты установлены
|
||
return 301 https://$host$request_uri;
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl default_server;
|
||
server_name _;
|
||
resolver 127.0.0.11 ipv6=off;
|
||
|
||
ssl_certificate /etc/nginx/ssl/server.crt;
|
||
ssl_certificate_key /etc/nginx/ssl/server.key;
|
||
ssl_protocols TLSv1.2 TLSv1.3;
|
||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||
ssl_prefer_server_ciphers on;
|
||
|
||
root /usr/share/nginx/html;
|
||
index index.html;
|
||
|
||
location / {
|
||
try_files $uri $uri/ /index.html;
|
||
}
|
||
|
||
|
||
location /api/ {
|
||
set $backend_api http://backend:8000;
|
||
proxy_pass $backend_api;
|
||
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 https;
|
||
proxy_set_header X-Trace-ID $http_x_trace_id;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
|
||
location /ws/ {
|
||
set $backend_ws http://backend:8000;
|
||
proxy_pass $backend_ws;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection "upgrade";
|
||
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 https;
|
||
proxy_set_header X-Trace-ID $http_x_trace_id;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
|
||
# @RATIONALE OAuth metadata must retain the external HTTPS authority; SSE must stream.
|
||
# @REJECTED SPA fallback for MCP paths returned HTML instead of protocol responses.
|
||
location ~ ^/(mcp(?:/|$)|oauth/|\.well-known/) {
|
||
set $backend_mcp http://backend:8000;
|
||
proxy_pass $backend_mcp;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Host $http_host;
|
||
proxy_set_header Connection "";
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto https;
|
||
proxy_set_header X-Trace-ID $http_x_trace_id;
|
||
proxy_buffering off;
|
||
proxy_cache off;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
}
|
||
# #endregion docker.nginx.ssl.conf
|