code_junkie

Nginx + fastcgi truncation problem

Nov 11th, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. python ./manage.py runfcgi umask=000 maxchildren=5 maxspare=1 minspare=0 method=prefork socket=/path/to/runfiles/django.sock pidfile=/path/to/runfiles/django.pid
  2.  
  3. # search and replace this: {project_location}
  4. pid /path/to/runfiles/nginx.pid;
  5. worker_processes 2;
  6. error_log /path/to/runfiles/error_log;
  7. events {
  8. worker_connections 1024;
  9. use epoll;
  10. }
  11. http {
  12. # default nginx location
  13. include /etc/nginx/mime.types;
  14. default_type application/octet-stream;
  15. log_format main
  16. '$remote_addr - $remote_user [$time_local] '
  17. '"$request" $status $bytes_sent '
  18. '"$http_referer" "$http_user_agent" '
  19. '"$gzip_ratio"';
  20. client_header_timeout 3m;
  21. client_body_timeout 3m;
  22. send_timeout 3m;
  23. connection_pool_size 256;
  24. client_header_buffer_size 1k;
  25. large_client_header_buffers 4 2k;
  26. request_pool_size 4k;
  27. output_buffers 4 32k;
  28. postpone_output 1460;
  29. sendfile on;
  30. tcp_nopush on;
  31. keepalive_timeout 75 20;
  32. tcp_nodelay on;
  33. client_max_body_size 10m;
  34. client_body_buffer_size 256k;
  35. proxy_connect_timeout 90;
  36. proxy_send_timeout 90;
  37. proxy_read_timeout 90;
  38. client_body_temp_path /path/to/runfiles/client_body_temp;
  39. proxy_temp_path /path/to/runfiles/proxy_temp;
  40. fastcgi_temp_path /path/to/runfiles/fastcgi_temp;
  41. gzip on;
  42. gzip_min_length 1100;
  43. gzip_buffers 4 32k;
  44. gzip_types text/plain text/html application/x-javascript text/xml text/css;
  45. ignore_invalid_headers on;
  46. server {
  47. listen 80;
  48. server_name alpha2.sonyalabs.com;
  49. index index.html;
  50. root /path/to/django-root/static;
  51. # static resources
  52. location ~* ^/static/.*$
  53. {
  54. root /path/to/django-root;
  55. expires 30d;
  56. break;
  57. }
  58. location / {
  59. # host and port to fastcgi server
  60. fastcgi_pass unix:/path/to/runfiles/django.sock;
  61. fastcgi_param PATH_INFO $fastcgi_script_name;
  62. fastcgi_param REQUEST_METHOD $request_method;
  63. fastcgi_param QUERY_STRING $query_string;
  64. fastcgi_param CONTENT_TYPE $content_type;
  65. fastcgi_param CONTENT_LENGTH $content_length;
  66. fastcgi_pass_header Authorization;
  67. fastcgi_intercept_errors off;
  68. }
  69. location /403.html {
  70. root /usr/local/nginx;
  71. access_log off;
  72. }
  73. location /401.html {
  74. root /usr/local/nginx;
  75. access_log off;
  76. }
  77. location /404.html {
  78. root /usr/local/nginx;
  79. access_log off;
  80. }
  81. location = /_.gif {
  82. empty_gif;
  83. access_log off;
  84. }
  85. access_log /path/to/runfiles/localhost.access_log main;
  86. error_log /path/to/runfiles/localhost.error_log;
  87. }
  88. }
Add Comment
Please, Sign In to add comment