# 本文件为默认的location配置, 无特殊需求, # 请勿修改 *********** # 本文件为默认的location配置, 无特殊需求, # 请勿修改 *********** #return 200 "$document_root $fastcgi_script_name not php ($realpath_root) - $request_filename - $document_root$fastcgi_path_info"; # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # http://nginx.org/en/docs/varindex.html location ~* ^/.+\.php { fastcgi_split_path_info ^(.+\.php)(/.*)$; if (!-e $document_root$fastcgi_script_name){ return 404; } fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param DOCUMENT_ROOT $document_root; } # Lua config # location ~* ^/.+\.lua { lua_code_cache off; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.lua)(/.+)$") { set $real_script_name $1; } # lua auto path if ( !-e $document_root$real_script_name ){ return 404; } content_by_lua_file $document_root$real_script_name; } ######################################################### 以下为固定值 ################################################################################ # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~* ^/\.ht { deny all; } location = /nginx_status { stub_status on; } # /favicon.ico location = /favicon.ico { default_type image/x-icon; if ( !-e $request_filename){ return 200 ""; } } # redirect server error pages to the static page /50x.html # error_page 400 401 403 404 500 502 503 504 /~nginx~/index.html; location /~nginx~/{ ssi on; internal; set $status_msg ""; set $status_msg_log ""; if ($status = 400){ set $status_msg "Bad Request"; set $status_msg_log "The server cannot process the request due to a client error."; } if ($status = 401){ set $status_msg "Unauthorized"; set $status_msg_log "The request has not been applied because it lacks valid authentication credentials for the target resource."; } if ($status = 403){ set $status_msg "Forbidden"; set $status_msg_log "The server refused to authorize the request."; } if ($status = 404){ set $status_msg "Not Found"; set $status_msg_log "The requested file or page cannot be found at this address"; } if ($status = 500){ set $status_msg "Internal server error"; set $status_msg_log "The server encountered an unexpected condition that prevented it from fulfilling the request."; } if ($status = 502){ set $status_msg "Bad Gateway"; set $status_msg_log "The server, while acting as a gateway or proxy, received an invalid response from an inbound server."; } if ($status = 503){ set $status_msg "Service Unavailable"; set $status_msg_log "The server is currently down for maintenance."; } if ($status = 504){ set $status_msg "Gateway Timeout"; set $status_msg_log "The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server."; } alias error/; }