fastcgi_cache_lock_timeout 0s;
fastcgi_cache_lock_age 86400s;

fastcgi_buffering on;
fastcgi_buffer_size 64k;
fastcgi_buffers 32 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;

fastcgi_send_timeout 86400s;
fastcgi_read_timeout 86400s;
fastcgi_connect_timeout 86400s;

try_files $fastcgi_script_name =404;

fastcgi_index index.php;

fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;

fastcgi_keep_conn on;
fastcgi_param HTTP_PROXY "";
fastcgi_param REDIRECT_STATUS 200;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param REQUEST_URI $request_uri;
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 HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;

fastcgi_cache_lock on;
fastcgi_cache_min_uses 1;
fastcgi_cache_revalidate on;
fastcgi_no_cache $no_cache;
fastcgi_cache_bypass $no_cache;
fastcgi_cache_valid 200 302 1h;
#fastcgi_cache_valid 301 1s;
#fastcgi_cache_valid 404 500 502 504 1s;
fastcgi_cache_key "$scheme$request_method$mobile_request$host$request_uri";
fastcgi_cache_use_stale error timeout updating invalid_header http_500 http_503;