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;

}


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