server {
listen 80;
server_name yshagent.cn;
access_log off;
error_log /var/log/nginx/yshagent.cn-error.log error;
set $root '/home/vagrant/code/ysh2agent/public';
location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
{
root $root;
}
root $root;
index index.php index.html index.htm;
location @rewrite {
rewrite ^(.*)$ index.php/$1 last;
}
location /{
if ( !-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.php {
root $root;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
include fastcgi_params;
}
}
Vagrant中Nginx对应Thinkphp5配置
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- vagrant下安装laravel框架 Laravel使用Composer来管理代码依赖。所以,在使用Larave...