#thinkphp 应用目录
location ~ ^/(api)/ {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php/$1 last;
}
}
#静态文件
location ~ ^/assets/ {
break;
}
#反向 HBuilder X 测试环境
location / {
proxy_pass http://127.0.0.1:5173;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
本站文章除注明转载/出处外,均为博主 spooking 原创或翻译,转载前请务必署名。