Xray-core
Xray-core copied to clipboard
Xray前置后,nginx的转发存在问题
Xray fallback到监听10001端口的nginx, nginx已经按照官方示例设置了转发,nextcloud依然出现下图提示。

按下示配置
location = /.well-known/carddav { return 301 /remote.php/dav/; }
location = /.well-known/caldav { return 301 /remote.php/dav/; }
会跳转到https://nextcloud.example.com:10001/remote.php/dav
改成
location = /.well-known/carddav { return 301 https://nextcloud.example.com/remote.php/dav/; }
location = /.well-known/caldav { return 301 https://nextcloud.example.com/remote.php/dav/; }
才会正常跳转
请问有什么办法可以让nginx按照官方示例正常跳转吗
我也是小白,我这边写的是 return 301 https://$server_name/remote.php/dav 可以的
我也是小白,我这边写的是 return 301 https://$server_name/remote.php/dav 可以的
这样的确可以👍
但是不知道有没有办法省略前面的https://$server_name
server {
listen 80; #IPv4,http默认监听端口。
listen [::]:80; #IPv6,http默认监听端口。无IPv6,此项可以删除。
return 301 https://$host$request_uri; #http自动跳转https,让网站看起来更真实。
}
这个需要理解本质:Nginx 收到的是 http/h2c 流量而不是 https 流量,return 301 默认当然会补上 http:// 而不是 https://