Skip to content

Instantly share code, notes, and snippets.

@rbrancher
Created January 22, 2013 20:59
Show Gist options
  • Save rbrancher/4598367 to your computer and use it in GitHub Desktop.
Save rbrancher/4598367 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen 443;
server_name lumini.com.br www.lumini.com.br lumini-app-874277573.us-east-1.elb.amazonaws.com 107.22.255.53 ec2-174-129-157-250.compute-1.amazonaws.com;
charset utf-8;
root /home/ubuntu/rails_apps/lumini.com.br/current/public;
try_files $uri/index.html $uri.html $uri @unicorn;
ssl on;
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location ~ ^/assets|uploads/ {
expires max;
add_header Cache-Control public;
}
location /downloads/ {
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
}
default_type application/octet-stream;
}
location @unicorn {
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_pass http://localhost:5002;
send_timeout 300;
proxy_read_timeout 300;
proxy_connect_timeout 300;
}
client_max_body_size 4G;
keepalive_timeout 10;
error_page 500 502 503 504 /500.html;
location = /500.html {
root /home/ubuntu/rails_apps/lumini.com.br/current/public;
}
}
# output compression saves bandwidth
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
# make sure gzip does not lose large gzipped js or css files
# see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl
gzip_buffers 16 8k;
# Disable gzip for certain browsers.
gzip_disable “MSIE [1-6].(?!.*SV1)”;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment