|
|
worker_processes 1; |
|
|
pid /tmp/nginx.pid; |
|
|
error_log stderr info; |
|
|
|
|
|
events { |
|
|
worker_connections 1024; |
|
|
} |
|
|
|
|
|
http { |
|
|
include /etc/nginx/mime.types; |
|
|
default_type application/octet-stream; |
|
|
|
|
|
|
|
|
access_log /dev/stdout; |
|
|
client_body_temp_path /tmp/client_temp; |
|
|
proxy_temp_path /tmp/proxy_temp; |
|
|
fastcgi_temp_path /tmp/fastcgi_temp; |
|
|
uwsgi_temp_path /tmp/uwsgi_temp; |
|
|
scgi_temp_path /tmp/scgi_temp; |
|
|
|
|
|
sendfile on; |
|
|
keepalive_timeout 65; |
|
|
|
|
|
upstream streamlit { |
|
|
server 127.0.0.1:8501; |
|
|
} |
|
|
|
|
|
upstream fastapi { |
|
|
server 127.0.0.1:8000; |
|
|
} |
|
|
|
|
|
upstream prometheus { |
|
|
server 127.0.0.1:9090; |
|
|
} |
|
|
|
|
|
upstream alertmanager { |
|
|
server 127.0.0.1:9093; |
|
|
} |
|
|
|
|
|
upstream pushgateway { |
|
|
server 127.0.0.1:9091; |
|
|
} |
|
|
|
|
|
server { |
|
|
listen 7860; |
|
|
server_name localhost; |
|
|
|
|
|
|
|
|
location /health { |
|
|
proxy_pass http://fastapi/health; |
|
|
proxy_set_header Host $host; |
|
|
} |
|
|
|
|
|
|
|
|
location /docs { |
|
|
proxy_pass http://fastapi/docs; |
|
|
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 /redoc { |
|
|
proxy_pass http://fastapi/redoc; |
|
|
proxy_set_header Host $host; |
|
|
} |
|
|
|
|
|
location /openapi.json { |
|
|
proxy_pass http://fastapi/openapi.json; |
|
|
proxy_set_header Host $host; |
|
|
} |
|
|
|
|
|
|
|
|
location /predict { |
|
|
proxy_pass http://fastapi/predict; |
|
|
proxy_set_header Host $host; |
|
|
} |
|
|
|
|
|
location /predictions { |
|
|
proxy_pass http://fastapi/predictions; |
|
|
proxy_set_header Host $host; |
|
|
} |
|
|
|
|
|
|
|
|
location /metrics { |
|
|
proxy_pass http://fastapi/metrics; |
|
|
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 = /grafana { |
|
|
return 301 /grafana/; |
|
|
} |
|
|
|
|
|
location /grafana/ { |
|
|
|
|
|
proxy_pass http://127.0.0.1:3000; |
|
|
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_set_header X-Forwarded-Host $host; |
|
|
proxy_set_header X-Forwarded-Server $host; |
|
|
|
|
|
proxy_http_version 1.1; |
|
|
proxy_set_header Upgrade $http_upgrade; |
|
|
proxy_set_header Connection "upgrade"; |
|
|
} |
|
|
|
|
|
|
|
|
location = /prometheus { |
|
|
return 301 /prometheus/; |
|
|
} |
|
|
|
|
|
|
|
|
location /prometheus/ { |
|
|
proxy_pass http://127.0.0.1:9090/prometheus/; |
|
|
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 /alertmanager/ { |
|
|
proxy_pass http://alertmanager; |
|
|
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 /pushgateway/ { |
|
|
proxy_pass http://pushgateway; |
|
|
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 / { |
|
|
proxy_pass http://streamlit; |
|
|
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_set_header X-Forwarded-Host $host; |
|
|
|
|
|
|
|
|
proxy_http_version 1.1; |
|
|
proxy_set_header Upgrade $http_upgrade; |
|
|
proxy_set_header Connection "upgrade"; |
|
|
proxy_read_timeout 86400; |
|
|
|
|
|
|
|
|
proxy_connect_timeout 60s; |
|
|
proxy_send_timeout 60s; |
|
|
} |
|
|
} |
|
|
} |
|
|
|