You've already forked Mailu
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:
12
nginx/start.py
Executable file
12
nginx/start.py
Executable 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;"])
|
Reference in New Issue
Block a user