Spaces:
Sleeping
Sleeping
Commit ·
3e88f9b
1
Parent(s): 904b7f9
add secret.
Browse files- nginx/nginx.conf +10 -0
- supervisor/supervisor.conf +43 -0
nginx/nginx.conf
CHANGED
|
@@ -69,6 +69,16 @@ http {
|
|
| 69 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 70 |
}
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
# appdjango 媒体文件
|
| 73 |
location /media/ {
|
| 74 |
alias /app/app_django/media/;
|
|
|
|
| 69 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 70 |
}
|
| 71 |
|
| 72 |
+
location /supervisor/ {
|
| 73 |
+
proxy_pass http://127.0.0.1:9001/;
|
| 74 |
+
proxy_set_header Host $host:$proxy_port;
|
| 75 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 76 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 77 |
+
proxy_set_header X-Forwarded-Host $http_host;
|
| 78 |
+
proxy_set_header X-Forwarded-Port $server_port;
|
| 79 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
# appdjango 媒体文件
|
| 83 |
location /media/ {
|
| 84 |
alias /app/app_django/media/;
|
supervisor/supervisor.conf
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
[supervisord]
|
| 3 |
nodaemon=true
|
|
@@ -5,6 +30,24 @@ user=user
|
|
| 5 |
logfile=/var/log/supervisor/supervisord.log
|
| 6 |
pidfile=/var/run/supervisord.pid
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
[program:nginx]
|
| 9 |
command=nginx -c "/app/nginx/nginx.conf"
|
| 10 |
autostart=true
|
|
|
|
| 1 |
+
; Sample supervisor config file.
|
| 2 |
+
;
|
| 3 |
+
; For more information on the config file, please see:
|
| 4 |
+
; http://supervisord.org/configuration.html
|
| 5 |
+
;
|
| 6 |
+
; Notes:
|
| 7 |
+
; - Shell expansion ("~" or "$HOME") is not supported. Environment
|
| 8 |
+
; variables can be expanded using this syntax: "%(ENV_HOME)s".
|
| 9 |
+
; - Quotes around values are not supported, except in the case of
|
| 10 |
+
; the environment= options as shown below.
|
| 11 |
+
; - Comments must have a leading space: "a=b ;comment" not "a=b;comment".
|
| 12 |
+
; - Command will be truncated if it looks like a config file comment, e.g.
|
| 13 |
+
; "command=bash -c 'foo ; bar'" will truncate to "command=bash -c 'foo ".
|
| 14 |
+
;
|
| 15 |
+
; Warning:
|
| 16 |
+
; Paths throughout this example file use /tmp because it is available on most
|
| 17 |
+
; systems. You will likely need to change these to locations more appropriate
|
| 18 |
+
; for your system. Some systems periodically delete older files in /tmp.
|
| 19 |
+
; Notably, if the socket file defined in the [unix_http_server] section below
|
| 20 |
+
; is deleted, supervisorctl will be unable to connect to supervisord.
|
| 21 |
+
|
| 22 |
+
[inet_http_server] ; inet (TCP) server disabled by default
|
| 23 |
+
port=127.0.0.1:9001 ; ip_address:port specifier, *:port for all iface
|
| 24 |
+
username=%(ENV_SUPERVISOR_USERNAME)s ; default is no username (open server)
|
| 25 |
+
password=%(ENV_SUPERVISOR_PASSWORD)s ; default is no password (open server)
|
| 26 |
|
| 27 |
[supervisord]
|
| 28 |
nodaemon=true
|
|
|
|
| 30 |
logfile=/var/log/supervisor/supervisord.log
|
| 31 |
pidfile=/var/run/supervisord.pid
|
| 32 |
|
| 33 |
+
; The rpcinterface:supervisor section must remain in the config file for
|
| 34 |
+
; RPC (supervisorctl/web interface) to work. Additional interfaces may be
|
| 35 |
+
; added by defining them in separate [rpcinterface:x] sections.
|
| 36 |
+
|
| 37 |
+
[rpcinterface:supervisor]
|
| 38 |
+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
| 39 |
+
|
| 40 |
+
; The supervisorctl section configures how supervisorctl will connect to
|
| 41 |
+
; supervisord. configure it match the settings in either the unix_http_server
|
| 42 |
+
; or inet_http_server section.
|
| 43 |
+
|
| 44 |
+
[supervisorctl]
|
| 45 |
+
serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
|
| 46 |
+
username=%(ENV_SUPERVISOR_USERNAME)s ; should be same as in [*_http_server] if set
|
| 47 |
+
password=%(ENV_SUPERVISOR_PASSWORD)s ; should be same as in [*_http_server] if set
|
| 48 |
+
prompt=supervisor ; cmd line prompt (default "supervisor")
|
| 49 |
+
history_file=/var/log/supervisor/supervisor.sc_history ; use readline history if available
|
| 50 |
+
|
| 51 |
[program:nginx]
|
| 52 |
command=nginx -c "/app/nginx/nginx.conf"
|
| 53 |
autostart=true
|