Files
khb_microservices/deploy/infra/todo.nginx.conf
2026-10-29 11:08:54 +03:00

49 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# todo.khbuild.freeddns.org: публичные входы сервиса todo_service (khb-todo-service, 127.0.0.1:8094).
# Открыты только: вебхуки JobTread (секрет в пути), MCP (JWT Keycloak или токен - проверяет сам сервис) и metadata защищённого ресурса.
# REST API для агентов наружу не публикуется (внутри docker-сети: http://khb-todo-service:8094).
server {
listen 80;
listen [::]:80;
server_name todo.khbuild.freeddns.org;
location ^~ /.well-known/acme-challenge/ { root /var/www/certbot; }
location / { return 301 https://$host$request_uri; }
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name todo.khbuild.freeddns.org;
ssl_certificate /etc/letsencrypt/live/khbuild-todo/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/khbuild-todo/privkey.pem;
client_max_body_size 1m;
location ^~ /webhooks/jobtread/ {
proxy_pass http://127.0.0.1:8094;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 30;
}
location = /mcp {
proxy_pass http://127.0.0.1:8094;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Authorization $http_authorization;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 120;
}
location = /.well-known/oauth-protected-resource {
proxy_pass http://127.0.0.1:8094;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
location / { return 404; }
}