Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (37 sloc) 1.41 KB
# Django-friendly config
server {
listen 80;
server_name example.com;
access_log /srv/vhosts/example.com/logs/access.log;
error_log /srv/vhosts/example.com/logs/error.log;
location /static {
root /srv/vhosts/example.com/treeio;
expires 360d;
}
location /favicon.ico {
alias /srv/vhosts/example.com/treeio/static/favicon.ico;
}
location /robots.txt {
alias /srv/vhosts/example.com/treeio/static/robots.txt;
}
location / {
fastcgi_pass unix:/tmp/treeio.fcgi;
# for a TCP host/port:
# fastcgi_pass {hostname}:{port};
# necessary parameter
fastcgi_param PATH_INFO $fastcgi_script_name;
# to deal with POST requests
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
# http://stackoverflow.com/questions/605173/how-to-nginx-virtual-servers-fcgi-for-django uses many other parameters,
# some may be necessary in some situations
}
}