Nginx URL重写报No input file specified. 错误

昨天在配置Nginx + fastcig_php的时候URL重写报了个No input file specified. 错误

GOOGLE了一下,网上都说是SCRIPT_FILENAME的问题,我试了下还是没有解决我的问题,今天我把$fastcgi_script_name这个变量写到了日志里发现URL被重写成了/hbj\x5C.php, 原来是我的URL重写规则写错了,后面的.是不需要转意的!

NGINX官方示列

rewrite ^/([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg last; 
rewrite ^/([-9]+)\-([-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg last; 
rewrite ^/([-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg last; 
rewrite "^/lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5" last; 
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4" last; 
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1" last; 
rewrite ^/([a-zA-Z0-9-]*)/([-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 last; 
rewrite ^/([-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 last; 
rewrite ^/([-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 last; 
rewrite ^/content/([-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 last; 
rewrite ^/([-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 last; 
rewrite ^/([-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 last; 
rewrite "^/lang-([a-z]{2})/(.*)$ /$2?isolang=$1" last;

你可能感兴趣的:(File,input,specified,No)