抱歉,如果标题没有意义。我将在这里详细说明。
背景。这适用于我使用 valet 的本地服务,但不适用于 Ubuntu 18.04 Production。我正在使用 Larvavel 6.18.7 和 nginx verison 1.17.3,并使用 Certbot 将 http 重定向到 https。我认为这是该平台的一个全面问题,但已将其归结为一个问题,只是一条通往Route::post('/business', 'BusinessController@store');
我已经调试了几个小时,所以我现在创建了一些测试页面,希望能更好地解释这一点。我现在在 Vue 组件中有两个 Axios POST 调用,但它实际上只是业务调用。
axios.post('/business', {'q':"hello"})
.then(res => {
console.log(res)
})
.catch(error => {
console.error(error)
});
axios.post('/test', {'q':"hello"})
.then(res => {
console.log(res)
})
.catch(error => {
console.error(error)
});
我遇到的问题/business是调用此路由时我得到 301 重定向。Laravel 不喜欢尾随 / 所以这就是为什么它是 403 但它不应该被重定向。
这两个都去同一个地方,我将它们放在我的路线的顶部以检查该业务是否未在其他任何地方调用:
Route::post('/test', 'BusinessController@store'); Route::post('/business', 'BusinessController@store');
这些调用完全相同,它们去往相同的位置,但/business
有一个重定向。
我试过清除路由缓存。我的日志中没有更多信息。我见过
至尊宝的传说