环境: 内核 debian 4.9 rc8 x64, docker容器 alpine 3.4, nginx 1.10.1, php 5.6.29, sqlite 3.13.0
nginx.conf 内容:
# run nginx in foreground
daemon off;
error_log /data/logs/nginx/nginx-error.log error;
pid /var/run/nginx.pid;
worker_processesauto;
events {
worker_connections1024;
}
http {
sendfileon;
include/etc/nginx/mime.types;
include/etc/nginx/fastcgi.conf;
default_typeapplication/octet-stream;
tcp_nopushon;
client_body_temp_path /tmp/nginx/body 1 2;
fastcgi_temp_path /tmp/nginx/fastcgi_temp 1 2;
client_max_body_size 2G;
server {
listen80;
root/data/www;
indexindex.php index.html index.htm;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# deny dot-files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location / {
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename) {
rewrite (.*) /index.php;
}
}
location ~ .*\.php(\/.*)*$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
}
}