问题原文
原帖链接 · Kevin Horst · CC BY-SA 3.0
when i have something this:
location ~ .php$ { ## Execute PHP scripts
if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
expires off; ## Do not cache dynamic content
include fastcgi_params; ## See /etc/nginx/fastcgi_params
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param ID_DEVELOPER_MODE 1;
}
is it important where to put the include directive? because the file /etc/nginx/fastcgi_params already has a SCRIPT_FILENAME declaration inside.
社区高分解答
原帖链接 · Richard Smith · CC BY-SA 3.0
The fastcgi_param directive is documented here. And although it is clear regarding inheritance it is not clear regarding the setting of the same parameter more than once (at the same level).
By experiment, it seems that nginx silently overwrites a previous value at the same level.
So the answer to your question is to place the include directive before any fastcgi_param directives that take priority.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
