自动摘要
正在生成中……
兼容http和https的修正方法是
nginx反代的设置(以nginx proxy manager自定义配置为例)
location /{
proxy_pass $forward_scheme://$server:$port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
# 注意这一行
proxy_set_header X-Forwarded-Proto https;
}
在blade模板<head>
加入:
@if(request()->header('X-Forwarded-Proto') == 'https')
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
@endif
相关讨论在https://github.com/livewire/livewire/issues/1216
关于这个指令的说明:修正混合内容 | Articles | web.dev