Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hoffmannkrzysztof/10596030 to your computer and use it in GitHub Desktop.
Save hoffmannkrzysztof/10596030 to your computer and use it in GitHub Desktop.
Default nginx config for site with fastcgi
server {
listen 8080;
server_name www.[site];
rewrite ^ http://[site]$request_uri? permanent;
}
server {
listen 8080;
server_name [site];
root /home/[site]/www/[site];
access_log off;
error_log /home/[site]/logs/[site].pl.error.log notice;
rewrite_log on;
client_max_body_size 5M;
location /media/ {
root /home/[site]/www/[site];
expires max;
autoindex off;
}
location /static/ {
root /home/[site]/www/[site];
expires max;
autoindex off;
}
location /static/admin/ {
alias /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin/;
}
location / {
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
fastcgi_pass 127.0.0.1:8902;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment