1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-06-15 00:05:11 +02:00

Prepare nginx as a unique frontend

This commit is contained in:
kaiyou
2017-09-24 14:01:03 +02:00
parent 995147f444
commit 755d9f0520
4 changed files with 42 additions and 14 deletions

12
nginx/start.py Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python
import jinja2
import os
import socket
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
# Actual startup script
os.environ["ADMIN_ADDRESS"] = socket.gethostbyname("admin")
convert("/conf/nginx.conf", "/etc/nginx/nginx.conf")
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])