Delegate TLS termination to the nginx reverse proxy

The app now listens on plain HTTP (127.0.0.1:5023 only) instead of
binding 443 and terminating TLS itself. Nginx handles TLS for
iptv.mrk.ovh and proxies to the app internally.
This commit is contained in:
ubuntu
2026-08-30 11:47:25 +00:00
parent 3eb0d5e8cd
commit df36139bd5
2 changed files with 3 additions and 12 deletions
+1 -3
View File
@@ -24,11 +24,9 @@ services:
networks: networks:
- app-network - app-network
volumes: volumes:
- /etc/letsencrypt/:/home/letsencrypt/:rw
- /home/ubuntu/serverIPTV/:/home/:rw - /home/ubuntu/serverIPTV/:/home/:rw
ports: ports:
- "5023:5023" - "127.0.0.1:5023:5023"
- "443:443"
networks: networks:
app-network: app-network:
+2 -9
View File
@@ -10,7 +10,6 @@ import asyncio
import os, glob import os, glob
import time import time
import json import json
import ssl
import sys import sys
import uuid import uuid
import logging import logging
@@ -87,8 +86,6 @@ sio.attach(app)
# Variables # Variables
path = os.path.dirname(os.path.realpath(__file__))+'/' path = os.path.dirname(os.path.realpath(__file__))+'/'
ssl_cert_path = '/home/letsencrypt/live/iptv.mrk.ovh/cert.pem'
ssl_key_path = '/home/letsencrypt/live/iptv.mrk.ovh/privkey.pem'
UPLOAD_PLAYLIST_DIR = "playlists" UPLOAD_PLAYLIST_DIR = "playlists"
DOWNLOAD_EPG_DIR = "epg" DOWNLOAD_EPG_DIR = "epg"
LOGO_DIR = "/home/logos" LOGO_DIR = "/home/logos"
@@ -100,10 +97,6 @@ DEVICE_SNAPSHOT_DIR.mkdir(parents=True, exist_ok=True)
# Set up Tornado template loader # Set up Tornado template loader
loader = Loader('') loader = Loader('')
# SSL context setup
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_context.load_cert_chain(certfile=ssl_cert_path, keyfile=ssl_key_path)
# Generic functions # Generic functions
def findInfo(tag, s): def findInfo(tag, s):
@@ -1577,5 +1570,5 @@ async def polling(sid, data):
# Main # Main
if __name__ == '__main__': if __name__ == '__main__':
logger.info('Starting server on port 443') logger.info('Starting server on port 5023')
web.run_app(app, ssl_context=ssl_context, port=443) web.run_app(app, port=5023)