Harden Apache SSL proxy and uvicorn запуск
Add HTTP->HTTPS redirect, SSL settings, and run uvicorn via Python module for compatibility.
This commit is contained in:
@@ -1,12 +1,21 @@
|
|||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName tts.ncue.net
|
ServerName tts.ncue.net
|
||||||
|
Redirect permanent / https://tts.ncue.net/
|
||||||
|
</VirtualHost>
|
||||||
|
|
||||||
|
<VirtualHost *:443>
|
||||||
|
ServerName tts.ncue.net
|
||||||
|
|
||||||
|
SSLEngine on
|
||||||
|
SSLCertificateFile /etc/letsencrypt/live/ncue.net/fullchain.pem
|
||||||
|
SSLCertificateKeyFile /etc/letsencrypt/live/ncue.net/privkey.pem
|
||||||
|
# 선택: 체인 파일이 필요하면 아래 경로 사용
|
||||||
|
# SSLCertificateChainFile /etc/letsencrypt/live/ncue.net/chain.pem
|
||||||
|
|
||||||
ProxyPreserveHost On
|
|
||||||
ProxyRequests Off
|
ProxyRequests Off
|
||||||
|
ProxyPreserveHost On
|
||||||
|
|
||||||
|
# 전체 프록시 (FastAPI가 정적/템플릿 포함 제공)
|
||||||
ProxyPass / http://127.0.0.1:8019/
|
ProxyPass / http://127.0.0.1:8019/
|
||||||
ProxyPassReverse / http://127.0.0.1:8019/
|
ProxyPassReverse / http://127.0.0.1:8019/
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/tts_error.log
|
|
||||||
CustomLog ${APACHE_LOG_DIR}/tts_access.log combined
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ fi
|
|||||||
|
|
||||||
python -m pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
|
|
||||||
PORT="${PORT}" nohup uvicorn server.main:app --host 0.0.0.0 --port "${PORT}" > server.log 2>&1 &
|
PORT="${PORT}" nohup python -m uvicorn server.main:app --host 0.0.0.0 --port "${PORT}" > server.log 2>&1 &
|
||||||
echo "Server started (PID: $!). Logs: server.log"
|
echo "Server started (PID: $!). Logs: server.log"
|
||||||
|
|||||||
Reference in New Issue
Block a user