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:
@@ -10,7 +10,6 @@ import asyncio
|
||||
import os, glob
|
||||
import time
|
||||
import json
|
||||
import ssl
|
||||
import sys
|
||||
import uuid
|
||||
import logging
|
||||
@@ -87,8 +86,6 @@ sio.attach(app)
|
||||
|
||||
# Variables
|
||||
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"
|
||||
DOWNLOAD_EPG_DIR = "epg"
|
||||
LOGO_DIR = "/home/logos"
|
||||
@@ -100,10 +97,6 @@ DEVICE_SNAPSHOT_DIR.mkdir(parents=True, exist_ok=True)
|
||||
# Set up Tornado template 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
|
||||
def findInfo(tag, s):
|
||||
@@ -1577,5 +1570,5 @@ async def polling(sid, data):
|
||||
|
||||
# Main
|
||||
if __name__ == '__main__':
|
||||
logger.info('Starting server on port 443')
|
||||
web.run_app(app, ssl_context=ssl_context, port=443)
|
||||
logger.info('Starting server on port 5023')
|
||||
web.run_app(app, port=5023)
|
||||
|
||||
Reference in New Issue
Block a user