Merge pull request 'chore(devops): HTTPS для dev.meditron.tenvex.ru' (#91) from chore/nginx-https into dev
CI / ruff · pytest (push) Successful in 2m16s
CI / ruff · pytest (push) Successful in 2m16s
This commit was merged in pull request #91.
This commit is contained in:
@@ -23,7 +23,7 @@ services:
|
|||||||
- --browser.gatherUsageStats=false
|
- --browser.gatherUsageStats=false
|
||||||
environment:
|
environment:
|
||||||
API_BASE_URL: http://app:8000
|
API_BASE_URL: http://app:8000
|
||||||
DASHBOARD_PUBLIC_URL: ${PUBLIC_URL:-http://localhost}/doctor
|
DASHBOARD_PUBLIC_URL: ${PUBLIC_URL:-https://dev.meditron.tenvex.ru}/doctor
|
||||||
ports: !override
|
ports: !override
|
||||||
- "127.0.0.1:8511:8501"
|
- "127.0.0.1:8511:8501"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
@@ -1,14 +1,70 @@
|
|||||||
# meditron.tenvex.ru — PTSRaiAgent prototype (synthetic data only).
|
# PTSRaiAgent prototype (synthetic data only) — shared host with vobot.
|
||||||
# / patient web app (static, web/dist)
|
# / patient web app (static, web/dist)
|
||||||
# /api/ FastAPI (127.0.0.1:8010)
|
# /api/ FastAPI (127.0.0.1:8010)
|
||||||
# /doctor/ Streamlit doctor dashboard + demo console (127.0.0.1:8511, baseUrlPath=doctor)
|
# /doctor/ Streamlit doctor dashboard + demo console (127.0.0.1:8511, baseUrlPath=doctor)
|
||||||
# TLS: after the DNS A-record exists — certbot --nginx -d meditron.tenvex.ru
|
# dev.meditron.tenvex.ru — HTTPS (Let's Encrypt, certbot certonly --nginx, auto-renew).
|
||||||
|
# meditron.tenvex.ru — HTTP until its DNS record exists; then: certbot certonly --nginx -d meditron.tenvex.ru
|
||||||
|
# and move it into an HTTPS block like dev.meditron.
|
||||||
|
|
||||||
map $http_upgrade $ptsr_connection_upgrade {
|
map $http_upgrade $ptsr_connection_upgrade {
|
||||||
default upgrade;
|
default upgrade;
|
||||||
'' close;
|
'' close;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name dev.meditron.tenvex.ru;
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
listen [::]:443 ssl;
|
||||||
|
server_name dev.meditron.tenvex.ru;
|
||||||
|
|
||||||
|
ssl_certificate /etc/letsencrypt/live/dev.meditron.tenvex.ru/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/dev.meditron.tenvex.ru/privkey.pem;
|
||||||
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||||
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/ptsr-access.log;
|
||||||
|
client_max_body_size 5m;
|
||||||
|
|
||||||
|
root /srv/ptsr/app/web/dist;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://127.0.0.1:8010;
|
||||||
|
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;
|
||||||
|
proxy_read_timeout 120s; # chat agent + scheduler replay on clock advance
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(docs|openapi.json|health)$ {
|
||||||
|
proxy_pass http://127.0.0.1:8010;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /doctor/ {
|
||||||
|
proxy_pass http://127.0.0.1:8511;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $ptsr_connection_upgrade;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_read_timeout 86400s;
|
||||||
|
proxy_buffering off;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
|
|||||||
Reference in New Issue
Block a user