現(xiàn)在配置文件如下,已經(jīng)有一個站點在工作了。新建了一個laravel的工程,在其他路徑:/var/www/html/laravel.
如何配置才能正常訪問 sms.dev/laravel/path ?
server{
listen 80;
server_name sms.dev;
index index.php index.html index.htm;
root /var/www/html/sms;
location /laravel/ {
# 這里如何配置呢?
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
if (!-e $request_filename) {
return 404;
}
}
4 回答

寶慕林4294392
TA貢獻(xiàn)2021條經(jīng)驗 獲得超8個贊
謝邀。
方式很多種。
1.匹配到 localtion 后,修改 root 即可,推薦方式
2.匹配到 location 后,內(nèi)部反向代理到新的 server 即可。

MM們
TA貢獻(xiàn)1886條經(jīng)驗 獲得超2個贊
location /xxx {
try_files $uri $uri/ /xxx/index.php?$query_string;
}
- 4 回答
- 0 關(guān)注
- 1129 瀏覽
添加回答
舉報
0/150
提交
取消