Files
khb_microservices/deploy/infra/reports.nginx.conf
Yuri Yaryshev 03abdfb1b8
All checks were successful
ci / test (push) Successful in 18s
ci / deploy (push) Successful in 1m18s
Доступ к отчётам по почте @khbuild.pro, редирект корневого домена, docs/new_reports.md
Доступ к reports.khbuild.freeddns.org: любой пользователь с подтверждённой
почтой @khbuild.pro (вместо группы /it-admins). Корневой домен
khbuild.freeddns.org редиректит на home (vhost khbuild-apex, сертификат).
docs/new_reports.md: инструкция для агентов по добавлению отчётов.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 09:28:18 +03:00

77 lines
3.2 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.

# reports.khbuild.freeddns.org: список отчётов и визуализации.
# Все пути закрыты входом Keycloak (Google) через oauth2-proxy khbuild-oauth2-proxy-reports (127.0.0.1:4181), доступ: любой пользователь с почтой @khbuild.pro.
# / -> пакет reports (127.0.0.1:8087), статический список ссылок
# /viz/ -> пакет khbuild_process_viz (127.0.0.1:8086); токен сервиса добавляется здесь из khbuild-secrets, в браузер он не попадает
server {
listen 80;
listen [::]:80;
server_name reports.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 reports.khbuild.freeddns.org;
ssl_certificate /etc/letsencrypt/live/khbuild-reports/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/khbuild-reports/privkey.pem;
client_max_body_size 1m;
location = /oauth2/auth {
proxy_buffer_size 16k;
proxy_buffers 8 16k;
proxy_busy_buffers_size 32k;
proxy_pass http://127.0.0.1:4181;
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-Auth-Request-Redirect $scheme://$host$request_uri;
}
location /oauth2/ {
proxy_buffer_size 16k;
proxy_buffers 8 16k;
proxy_busy_buffers_size 32k;
proxy_pass http://127.0.0.1:4181;
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-Auth-Request-Redirect $scheme://$host$request_uri;
}
location = /viz { return 301 /viz/; }
location /viz/ {
auth_request /oauth2/auth;
error_page 401 = /oauth2/start?rd=$scheme://$host$request_uri;
auth_request_set $auth_email $upstream_http_x_auth_request_email;
proxy_set_header X-Forwarded-Email $auth_email;
include /etc/nginx/khbuild-secrets/reports-viz-token.conf;
proxy_pass http://127.0.0.1:8086/;
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_read_timeout 120;
}
location / {
auth_request /oauth2/auth;
error_page 401 = /oauth2/start?rd=$scheme://$host$request_uri;
auth_request_set $auth_email $upstream_http_x_auth_request_email;
proxy_set_header X-Forwarded-Email $auth_email;
proxy_pass http://127.0.0.1:8087;
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;
}
}