Lots of changes
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
upstream app_server {
|
||||
server 127.0.0.1:8000 fail_timeout=0;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
keepalive_timeout 5;
|
||||
|
||||
ssl_certificate /etc/ssl/geeksbot_app_cert_chain.crt;
|
||||
ssl_certificate_key /etc/ssl/geeksbot.app.key;
|
||||
|
||||
access_log /tmp/logs/geeksbot/access.log;
|
||||
error_log /tmp/logs/geeksbot/error.log;
|
||||
|
||||
location /static/ {
|
||||
alias /code/staticfiles/;
|
||||
}
|
||||
|
||||
location /error/ {
|
||||
alias /code/staticfiles/errors/;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri @proxy_to_app;
|
||||
}
|
||||
|
||||
location @proxy_to_app {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
proxy_read_timeout 180;
|
||||
proxy_connect_timeout 180;
|
||||
|
||||
if (!-f $request_filename) {
|
||||
proxy_pass http://app_server;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /error/maintenance.html;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import multiprocessing
|
||||
|
||||
bind = "0.0.0.0:8000"
|
||||
workers = multiprocessing.cpu_count() * 2 + 1
|
||||
worker_class = "gevent"
|
||||
worker_connections = 4096
|
||||
timeout = 180
|
||||
backlog = 2048
|
||||
pidfile = "/tmp/geeksbot.pid"
|
||||
reload = True
|
||||
@@ -0,0 +1,44 @@
|
||||
user geeksbot;
|
||||
master_process off;
|
||||
# set open fd limit to 30000
|
||||
worker_rlimit_nofile 30000;
|
||||
pid /var/run/nginx.pid;
|
||||
daemon off;
|
||||
|
||||
events {
|
||||
worker_connections 4096;
|
||||
accept_mutex off;
|
||||
}
|
||||
|
||||
http {
|
||||
# Basic Settings
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
client_max_body_size 200M;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
# Logging
|
||||
access_log /tmp/logs/nginx/access.log;
|
||||
error_log /tmp/logs/nginx/error.log;
|
||||
|
||||
# Gzip
|
||||
|
||||
gzip on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 2;
|
||||
gzip_http_version 1.1;
|
||||
gzip_buffers 16 8k;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml applicaion/xml application/xml-rss text/javascript;
|
||||
gzip_disable "msie6";
|
||||
gzip_vary on;
|
||||
|
||||
# Virtual Host Configs
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
[program:geeksbot]
|
||||
command=/usr/local/bin/gunicorn config.wsgi:application -c /etc/gunicorn.conf
|
||||
directory=/code/
|
||||
stdout_logfile=/tmp/logs/geeksbot/gunicorn.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
user=geeksbot
|
||||
|
||||
[program:nginx]
|
||||
command=/usr/sbin/nginx
|
||||
stdout_logfile=/tmp/logs/nginx/access.log
|
||||
stderr_logfile=/tmp/logs/nginx/error.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
@@ -0,0 +1,21 @@
|
||||
[unix_http_server]
|
||||
file=/tmp/supervisor.sock
|
||||
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/tmp/logs/supervisord.log
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=0
|
||||
loglevel=info
|
||||
pidfile=/tmp/supervisord.pid
|
||||
minfds=1024 ; min available startup file descriptors
|
||||
minprocs=200 ; min available process descriptors
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///tmp/supervisor.sock
|
||||
|
||||
[include]
|
||||
files = /etc/supervisor/conf.d/*.conf
|
||||
Reference in New Issue
Block a user