From 06b1e1466f90b671847bef861e96e10946a74ab7 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 2 Oct 2013 21:21:22 +0000 Subject: [PATCH] Have nginx serve the static files to not overwhelm flask. --- nginx.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nginx.conf b/nginx.conf index 4efb0a7f1..c7209270e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -10,6 +10,8 @@ events { } http { + include /etc/nginx/mime.types; + default_type application/octet-stream; access_log /tmp/nginx.access.log combined; sendfile on; @@ -33,9 +35,6 @@ http { keepalive_timeout 5; - # path for static files - root /home/ubuntu/quay/static; - ssl on; ssl_certificate /home/ubuntu/quay/certs/unified.cert; ssl_certificate_key /home/ubuntu/quay/certs/quay.key; @@ -44,13 +43,14 @@ http { ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; ssl_prefer_server_ciphers on; - location / { + location /static/ { # checks for static file, if not found proxy to app - try_files $uri @proxy_to_app; + alias /home/ubuntu/quay/static/; } - location @proxy_to_app { + 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;