Want more features on Pastebin? Sign Up, it's FREE!
Guest

nginx.conf

By: a guest on Jul 5th, 2010  |  syntax: Bash  |  size: 2.08 KB  |  views: 290  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. user www-data;
  2. worker_processes  1;
  3.  
  4. error_log  /var/log/nginx/error.log;
  5. pid        /var/run/nginx.pid;
  6.  
  7. events {
  8.     worker_connections  1024;
  9.     # multi_accept on;
  10. }
  11.  
  12. http {
  13.     include       /etc/nginx/mime.types;
  14.  
  15.     access_log  /var/log/nginx/access.log;
  16.  
  17.     sendfile        on;
  18.     #tcp_nopush     on;
  19.  
  20.     #keepalive_timeout  0;
  21.     keepalive_timeout  65;
  22.     tcp_nodelay        on;
  23.  
  24.     gzip  on;
  25.     gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  26.  
  27.     include /etc/nginx/conf.d/*.conf;
  28.     include /etc/nginx/sites-enabled/*;
  29.  
  30.     # MOJE UPRAVY
  31.     server {
  32.       client_max_body_size 100m;
  33.       listen 80;
  34.       server_name 127.0.0.1;
  35.       location /sendfile/ {
  36.         internal;
  37.         alias /var/www/nginx/sendfile/;
  38.       }
  39.       location / {
  40.         root /var/www/nginx/;
  41.         rewrite ^/(.*) /index.php last;
  42.       }
  43.       location ~ \.php$ {
  44.         root /var/www/nginx;
  45.         include /etc/nginx/fastcgi_params; #or whatever you named it
  46.         fastcgi_pass  127.0.0.1:9000;
  47.       }
  48.       location /upload {
  49.         # Pass altered request body to this location
  50.         upload_pass   /test;
  51.  
  52.         # Store files to this directory
  53.         # The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
  54.         upload_store /tmp 1;
  55.        
  56.         # Allow uploaded files to be read only by user
  57.         upload_store_access user:r;
  58.  
  59.         # Set specified fields in request body
  60.         upload_set_form_field $upload_field_name.name "$upload_file_name";
  61.         upload_set_form_field $upload_field_name.content_type "$upload_content_type";
  62.         upload_set_form_field $upload_field_name.path "$upload_tmp_path";
  63.  
  64.         # Inform backend about hash and size of a file
  65.         upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5";
  66.         upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size";
  67.  
  68.         upload_pass_form_field "^submit$|^description$";
  69.  
  70.         upload_cleanup 400 404 499 500-505;
  71.       }
  72.       location /test {
  73.         proxy_pass http://127.0.0.1:8080;
  74.       }
  75.     }
  76.  
  77. }
clone this paste RAW Paste Data