Skip to content

Instantly share code, notes, and snippets.

@kitsunde
Created July 15, 2013 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitsunde/6000726 to your computer and use it in GitHub Desktop.
Save kitsunde/6000726 to your computer and use it in GitHub Desktop.
upstream cuteletter{
server 127.0.0.1:8000;
}
server {
listen 80;
listen 9001 default_server;
server_name www.cuteandfluffythings.com cuteandfluffythings.com;
access_log /var/log/nginx/cuteletter.access.log;
error_log /var/log/nginx/cuteletter.error.log;
keepalive_timeout 120;
client_max_body_size 20m;
root /home/ubuntu/cuteletter/src/cuteletter;
set $my_host $http_host;
if ($host ~ "\d+\.\d+\.\d+\.\d+") {
set $my_host "cuteandfluffythings.com";
}
location /static {
autoindex on;
alias /home/ubuntu/cuteletter/src/cuteletter/cuteletter/static;
expires max;
access_log off;
}
location /robots.txt {
alias /home/ubuntu/cuteletter/src/cuteletter/cuteletter/static/robots.txt;
access_log off;
}
location /favicon.ico {
alias /home/ubuntu/cuteletter/src/cuteletter/cuteletter/static/favicon.ico;
expires max;
access_log off;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $my_host;
proxy_redirect off;
proxy_pass http://cuteletter;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment