redirect 方法会丢失端口号
想返回一个重定向到支付成功页面
return redirect()->route('payment.success');
最后重定向的结果是没带端口号的 http://localhost/api/result, 但是如果打印
route('payment.success')
是有端口号的 http://localhost:8000/api/result ,在.env里APP_URL也是配置了的localhost:8000,
这是什么原因呢
本作品采用《CC 协议》,转载必须注明作者和本文链接
redirct获取的域名是header中携带的host,如果需要在调整时携带端口的话需要在nginx或appche 中将Host 设置为host:port。 例如nginx设置 :proxy_set_header Host $host:port