nginx 反向代理服务器,用来代理访问路径的跳转
虚拟主机的配置
访问路径: http://dev.admin.com:80
server {
listen 80; //监听端口号
server_name dev.admin.com; //监听端口号
charset utf-8;
root /Users/lvyi/www/application/admin; //项目文件位置
//根目录访问的默认文件
location / {
try_files $uri $uri/ /index.php?$args;
index index.php;
}
//php的配置
location ~ .*\.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
try_files $uri =404;
}
}