nginx配置多站点+git常用命令

nginx 配置文件路径   /usr/local/nginx/conf  nginx.conf
nginx 配置多站点 nginx.conf 主配置文件里 include /usr/local/nginx/conf/vhost/*.conf
各个站点 配置文件 都放在vhost目录下并以.conf后缀
例:
server{
listen    80;
server_name       你的项目名;
root     你的项目目录;
index    index.PHP   index.html;
location / {
try_files $uri/ /index.php?$args;
}
location ~ .*\.(php)?${
expires 1s;
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param  PATH_INFO $fastcgi_path_info;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass  你的端口地址;
}
access_log logs/你的项目名_access.log access;
error_log  logs/你的项目名_error.log;

}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章