added gunicorn service socket and nginx config.
This commit is contained in:
18
gunicorn.service
Normal file
18
gunicorn.service
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#cp to /etc/systemd/system/gunicorn.service
|
||||||
|
[Unit]
|
||||||
|
Description=gunicorn daemon
|
||||||
|
Requires=gunicorn.socket
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=www-data
|
||||||
|
WorkingDirectory=/root/appdirectory/
|
||||||
|
ExecStart=/root/appdirectory/testappenv/bin/gunicorn \
|
||||||
|
--access-logfile - \
|
||||||
|
--workers 3 \
|
||||||
|
--bind unix:/run/gunicorn.sock \
|
||||||
|
testapp.wsgi:application
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
9
gunicorn.socket
Normal file
9
gunicorn.socket
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#cp to /etc/systemd/system/gunicorn.socket
|
||||||
|
[Unit]
|
||||||
|
Description=gunicorn socket
|
||||||
|
|
||||||
|
[Socket]
|
||||||
|
ListenStream=/run/gunicorn.sock
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sockets.target
|
||||||
20
testapp.nginx
Normal file
20
testapp.nginx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#copy to /etc/nginx/sites-available
|
||||||
|
#link to: ln -s /etc/nginx/sites-available/testapp /etc/nginx/sites-enabled/
|
||||||
|
#nginx -t
|
||||||
|
# sytemctl restart nginx
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name develop.artemisneo.com;
|
||||||
|
|
||||||
|
location = /favicon.ico { access_log off; log_not_found off; }
|
||||||
|
|
||||||
|
location /static/ {
|
||||||
|
root /root/appdirectory/assets;
|
||||||
|
}
|
||||||
|
location / {
|
||||||
|
include proxy_params;
|
||||||
|
proxy_pass http://unix:/run/gunicorn.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user