user drycc;
worker_processes auto;
daemon off;
pid /tmp/nginx/nginx.pid;
events {
    worker_connections  1024;
}
error_log /tmp/nginx/logs/error.log error;
http {
    # Hide nginx version information.
    server_tokens off;

    sendfile    on;
    tcp_nopush  on;
    tcp_nodelay off;

    keepalive_timeout  65;

    log_format specialLog '$http_x_forwarded_for - '
                      '"$request" $status $body_bytes_sent '
                      '"$http_referer" "$http_user_agent" '
                      '$request_time';
    access_log /tmp/nginx/logs/access.log specialLog;
    client_body_temp_path /tmp/nginx/body;
    proxy_temp_path /tmp/nginx/proxy;
    fastcgi_temp_path /tmp/nginx/fastcgi;
    uwsgi_temp_path /tmp/nginx/uwsgi;
    scgi_temp_path /tmp/nginx/scgi;

    client_max_body_size 75m;
    client_body_timeout 600s;

# upstream php {
#         server unix:/tmp/php-fpm.sock max_fails=3 fail_timeout=3s;
#         keepalive 16;
#     }

    index index.html index.htm index.xhtml;

    include mime.types;
    default_type application/octet-stream;

    set_real_ip_from 0.0.0.0/0;
    real_ip_header X-Forwarded-For;

    # Enable Gzip compression.
    gzip on;
    gzip_http_version 1.0;
    gzip_comp_level 5;
    gzip_min_length 256;
    gzip_proxied any;
    gzip_vary on;
    gzip_types
      application/atom+xml
      application/javascript
      application/x-javascript
      application/json
      application/rss+xml
      application/vnd.ms-fontobject
      application/x-font-ttf
      application/x-web-app-manifest+json
      application/xhtml+xml
      application/xml
      font/opentype
      image/svg+xml
      image/x-icon
      text/css
      text/plain
      text/x-component;
    # text/html is always compressed by HttpGzipModule

    server {
        server_name _;
        listen 80;

        #Specify a charset
        charset utf-8;

        fastcgi_buffering off;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;

#         location / {
#             root  /workspace
#             index index.html index.htm index.php;
#         }

        location / {
            root /workspace/web/;
            fastcgi_pass unix:/tmp/php-fpm.sock;
#            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
    }
}
