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:
+1
-3
@@ -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:
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user