This repository has been archived by the owner on Oct 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add systemd services and nginx base config
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Add this to the main nginx.conf | ||
#gzip on; | ||
#gzip_disable "msie6"; | ||
#gzip_vary on; | ||
#gzip_proxied any; | ||
#gzip_comp_level 6; | ||
#gzip_types text/plain application/javascript application/octet-stream text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon; | ||
#gzip_min_length 256; | ||
|
||
|
||
# this config should be in the sites-enabled, use /usr/local prefix if nginx is installed under that directory otherwise remove this prefix from the directories below | ||
server { | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
server_name _; | ||
charset utf-8; | ||
# root /var/www/html; | ||
client_max_body_size 64M; | ||
#index index.html index.htm index.nginx-debian.html; | ||
|
||
location /static { | ||
alias /usr/local/var/www/daemo/; | ||
} | ||
|
||
location / { | ||
uwsgi_pass unix:/var/tmp/webserver.socket; | ||
include /usr/local/etc/nginx/uwsgi_params; | ||
# try_files $uri $uri/ =404; | ||
} | ||
|
||
location /ws/ { | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
proxy_pass http://unix:/var/tmp/websockets.socket; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Celery background tasks for Daemo | ||
After=network.target | ||
|
||
[Service] | ||
User=celery | ||
Group=celery | ||
ExecStart=/bin/bash -c 'cd /daemo; /usr/local/bin/celery -A csp worker -l info -B' | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=uWSGI instance to serve Daemo API | ||
After=syslog.target | ||
|
||
[Service] | ||
ExecStart=/bin/bash -c 'cd /daemo; /usr/local/bin/uwsgi --socket /var/tmp/webserver.socket --buffer-size=32768 --workers=5 --master --module csp.webserver --chmod-socket=666 --chown-socket=www-data:www-data' | ||
Restart=always | ||
KillSignal=SIGQUIT | ||
Type=notify | ||
StandardError=syslog | ||
NotifyAccess=all | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=uWSGI instance to serve web sockets | ||
After=syslog.target | ||
|
||
[Service] | ||
ExecStart=/bin/bash -c 'cd /daemo; /usr/local/bin/uwsgi --http-socket /var/tmp/websockets.socket --gevent=1000 --http-websockets --workers=2 --master --module csp.websockets --chmod-socket=666 --chown-socket=www-data:www-data' | ||
Restart=always | ||
KillSignal=SIGQUIT | ||
Type=notify | ||
StandardError=syslog | ||
NotifyAccess=all | ||
|
||
[Install] | ||
WantedBy=multi-user.target |