Skip to content

Instantly share code, notes, and snippets.

@shrawanx
Last active May 13, 2019 11:49
Show Gist options
  • Save shrawanx/c4cd469b120926300948fc902b087c3d to your computer and use it in GitHub Desktop.
Save shrawanx/c4cd469b120926300948fc902b087c3d to your computer and use it in GitHub Desktop.
Deploy Config
[watcher:webapp]
cmd = chaussette app.wsgi:application --fd $(circus.sockets.webapp)
uid=ubuntu
endpoint_owner=ubuntu
numprocesses = 3
use_sockets = True
copy_env = True
copy_path = True
virtualenv = /home/ubuntu/env/
stdout_stream.class = FileStream
stdout_stream.filename = /home/ubuntu/logs/webapp.log
stderr_stream.class = FileStream
stderr_stream.filename = /home/ubuntu/logs/webapp_err.log
#hooks.after_start = config.hooks.run_raven
# optionally rotate the log file when it reaches 1 gb
# and save 5 copied of rotated files
stdout_stream.max_bytes = 1073741824
stdout_stream.backup_count = 3
stderr_stream.max_bytes = 1073741824
stderr_stream.backup_count = 3
[socket:webapp]
host = 127.0.0.1
port = 8085
[env:webapp]
LOGS_DIR = /home/ubuntu/logs
PYTHONPATH=/home/ubuntu/app/
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
# server_name .example.com; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
location / {
# add_header 'Access-Control-Allow-Origin' '*';
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8085;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment