【发布时间】:2019-06-22 17:16:03
【问题描述】:
我需要将单个静态 URL 映射到我在配置文件中使用的特定 PHP 文件
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location /reset {
root html/sys;
try_files /index.php /index.php;
fastcgi_pass 127.0.0.1:9000; //PHP server
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Result = ("No input file specified.") 响应
如果我将返回 (try_files index.html;) 并删除 php 代理,那么它将返回 html 索引页面,此问题仅在它尝试返回 php 页面时发生
【问题讨论】:
标签: php nginx configuration