1. 路由不起作用
表现:访问http://local.test.com/laravel/public/api/user,提示404
解决:
Apache配置文件中修改两行:
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule rewrite_module modules/mod_rewrite.so...
<Directory "D:/php7.4">
...
AllowOverride noneAllowOverride All
2. nginx反向代理问题
表现:页面中route('login')产生的url带有端口号
解决:
nginx反向代理中增加一行:
server {
listen 80;
server_name local.test.com;location / {
proxy_pass http://127.0.0.1:89;
index index.html index.htm index.php;
proxy_set_header Host $host;
}
}