nginx 配置:
------------------------------
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /www/default;
index index.html index.htm index.php;
}
location ~.*\.php$ {
root /www/default;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
------
$ netstat -anl | grep 9000
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
------
每访问刷新一次
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:9000 127.0.0.1:34246 TIME_WAIT
tcp 0 0 127.0.0.1:9000 127.0.0.1:34245 TIME_WAIT
tcp 0 0 127.0.0.1:9000 127.0.0.1:34243 TIME_WAIT
tcp 0 0 127.0.0.1:9000 127.0.0.1:34247 TIME_WAIT
------
/www/default/
├── 1.txt
└── index.php
------
访问1.txt 正常... index.php内容:
<?php
phpinfo();
?>
访问index.php 一片空白,访问任何*.php 也是全空白。不提示404
------------------------------
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /www/default;
index index.html index.htm index.php;
}
location ~.*\.php$ {
root /www/default;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
------
$ netstat -anl | grep 9000
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
------
每访问刷新一次
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:9000 127.0.0.1:34246 TIME_WAIT
tcp 0 0 127.0.0.1:9000 127.0.0.1:34245 TIME_WAIT
tcp 0 0 127.0.0.1:9000 127.0.0.1:34243 TIME_WAIT
tcp 0 0 127.0.0.1:9000 127.0.0.1:34247 TIME_WAIT
------
/www/default/
├── 1.txt
└── index.php
------
访问1.txt 正常... index.php内容:
<?php
phpinfo();
?>
访问index.php 一片空白,访问任何*.php 也是全空白。不提示404