现有配置如下,想增加 config.js -> 重写到 config.php 且不允许直接访问config.php,怎么搞哦,谢谢哈。。。
server {
listen 80;
server_name js.mydomain.com;
charset utf-8;
set $root '/dat/www/js.mydomain.com/public';
root $root;
add_header Cache-Control no-cache;
add_header Cache-Control private;
index index.php index.html index.htm;
try_files $uri $uri/
@rewrite ;
location
@rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root $root;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}