728x90
nginx -> streamlit 프록시 설정.
추후 streamlit 서버를 도커로 올리고, k8s에서까지 구동 되도록... 노력할 예정...
최상단?에 있는 nginx 정방향 프록시 설정
server {
listen 80;
server_name llama.sample.site;
# HTTP에서 HTTPS로 리다이렉션
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name llama.sample.site;
ssl_certificate /etc/letsencrypt/live/sample.site/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/sample.site/privkey.pem;
if ($scheme != "https") {
return 301 https://$host$request_uri;
}
location / {
resolver 168.126.63.1;
proxy_pass http://10.0.0.121:8501$request_uri; # streamlit host
proxy_http_version 1.1; # streamlit
proxy_set_header Upgrade $http_upgrade; # streamlit
proxy_set_header Connection "upgrade"; # streamlit
proxy_read_timeout 86400;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Streamlit 서버 실행 명령어(메모)
streamlit run --server.runOnSave True --server.address 0.0.0.0 app.py
# 백그라운드 실행
nohup streamlit run --server.runOnSave True --server.address 0.0.0.0 app.py
728x90
'Infra' 카테고리의 다른 글
| [Proxmox] 랜섬웨어 방어 및 재해 복구(DR) 전략 (0) | 2025.11.29 |
|---|---|
| [Proxmox] ZFS RAID 복구 시나리오 (0) | 2025.11.29 |
| [Proxmox] GPU Passthrough (0) | 2023.12.09 |
| [SSL] certbot ssl 발급 : nginx forward proxy 설정까지 (0) | 2023.11.29 |
| [k8s] 모니터링 : Prometheus & Grafana (nginx ingress 설정까지) (1) | 2023.11.26 |