server {
listen 80;#监听80端口
server_name www.basic.com;#虚拟域名
root "D:/WWW/basic";#虚拟域名指向目录
location / {
index index.html index.htm index.php l.php;#autoindex当成首页的文件
autoindex on;
}
//配置php解析器,要不然它会把php后缀的文件当成一个静态文件下载
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
//代理设置
location /aaa{
access_log on;
rewrite ^/httk-admin/(.*?)$ /$1 break; #如果是访问/httk-admin/下 则代理到下面地址
proxy_pass http://********/aaa/$1?$query_string;
}
}