2014-01-02 20:13:15 +00:00
|
|
|
worker_processes 8;
|
2013-12-09 16:04:00 +00:00
|
|
|
|
|
|
|
user root nogroup;
|
2013-12-18 23:32:31 +00:00
|
|
|
pid /mnt/nginx/nginx.pid;
|
|
|
|
error_log /mnt/nginx/nginx.error.log;
|
2013-12-09 16:04:00 +00:00
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
accept_mutex off;
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
types_hash_max_size 2048;
|
2014-01-07 22:01:19 +00:00
|
|
|
include /usr/local/nginx/conf/mime.types.default;
|
2013-12-09 16:04:00 +00:00
|
|
|
|
|
|
|
default_type application/octet-stream;
|
2013-12-18 23:32:31 +00:00
|
|
|
access_log /mnt/nginx/nginx.access.log combined;
|
2013-12-09 16:04:00 +00:00
|
|
|
sendfile on;
|
|
|
|
|
|
|
|
root /root/quay/;
|
|
|
|
|
|
|
|
gzip on;
|
|
|
|
gzip_http_version 1.0;
|
|
|
|
gzip_proxied any;
|
|
|
|
gzip_min_length 500;
|
|
|
|
gzip_disable "MSIE [1-6]\.";
|
|
|
|
gzip_types text/plain text/xml text/css
|
|
|
|
text/javascript application/x-javascript
|
|
|
|
application/octet-stream;
|
|
|
|
|
|
|
|
upstream app_server {
|
|
|
|
server unix:/tmp/gunicorn.sock fail_timeout=0;
|
|
|
|
# For a TCP configuration:
|
|
|
|
# server 192.168.0.7:8000 fail_timeout=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2014-01-07 22:15:29 +00:00
|
|
|
listen 80 default_server;
|
2013-12-09 16:04:00 +00:00
|
|
|
server_name _;
|
|
|
|
rewrite ^ https://$host$request_uri? permanent;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2014-01-07 22:15:29 +00:00
|
|
|
listen 443 default;
|
2013-12-09 16:04:00 +00:00
|
|
|
client_max_body_size 8G;
|
2013-12-18 23:32:31 +00:00
|
|
|
client_body_temp_path /mnt/nginx/client_body 1 2;
|
2013-12-09 16:04:00 +00:00
|
|
|
server_name _;
|
|
|
|
|
|
|
|
keepalive_timeout 5;
|
|
|
|
|
|
|
|
ssl on;
|
|
|
|
ssl_certificate ./certs/quay-staging-unified.cert;
|
|
|
|
ssl_certificate_key ./certs/quay-staging.key;
|
|
|
|
ssl_session_timeout 5m;
|
|
|
|
ssl_protocols SSLv3 TLSv1;
|
|
|
|
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
|
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
|
|
|
|
if ($args ~ "_escaped_fragment_") {
|
|
|
|
rewrite ^ /snapshot$uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /static/ {
|
|
|
|
# checks for static file, if not found proxy to app
|
|
|
|
alias /root/quay/static/;
|
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_buffering off;
|
|
|
|
|
2014-01-07 21:35:38 +00:00
|
|
|
proxy_request_buffering off;
|
|
|
|
proxy_set_header Transfer-Encoding $http_transfer_encoding;
|
|
|
|
|
2013-12-09 16:04:00 +00:00
|
|
|
proxy_pass http://app_server;
|
|
|
|
proxy_read_timeout 2000;
|
2013-12-18 23:32:31 +00:00
|
|
|
proxy_temp_path /mnt/nginx/proxy_temp 1 2;
|
2013-12-09 16:04:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|