linux - fix unknown scheme error and do nginx reload as root in UI
This commit is contained in:
@@ -7,7 +7,7 @@ User=nginx
|
||||
Group=nginx
|
||||
WorkingDirectory=/opt/bunkerized-nginx/ui
|
||||
EnvironmentFile=/opt/bunkerized-nginx/ui/variables.env
|
||||
ExecStart=gunicorn --bind 127.0.0.1:5000 -m 007 wsgi:app
|
||||
ExecStart=gunicorn --config config.py --bind 127.0.0.1:5000 -m 007 wsgi:app
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
1
ui/config.py
Normal file
1
ui/config.py
Normal file
@@ -0,0 +1 @@
|
||||
secure_scheme_headers = {'X-FORWARDED-PROTOCOL': 'https', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}
|
||||
5
ui/linux-reload.sh
Normal file
5
ui/linux-reload.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
systemctl reload nginx
|
||||
|
||||
exit $?
|
||||
@@ -107,7 +107,7 @@ class Instances :
|
||||
if proc.returncode != 0 :
|
||||
result = False
|
||||
else :
|
||||
proc = subprocess.run(["/usr/sbin/nginx", "-s", "reload"], capture_output=True)
|
||||
proc = subprocess.run(["/opt/bunkerized-nginx/ui/nginx-reload.sh"], capture_output=True)
|
||||
result = proc.returncode == 0
|
||||
elif instance["type"] == "container" or instance["type"] == "service" :
|
||||
result = self.__api_request(instance, "/reload")
|
||||
|
||||
Reference in New Issue
Block a user