使用代理的WireCloud重定向URL [英] WireCloud redirect url with proxy
问题描述
在默认的WireCloud设置中单击sign in
时,在哪里可以手动设置url参数的一部分redirect_uri
?
Where can I manually set the redirect_uri
that is part of the url parameters when clicking on sign in
in the default WireCloud setup?
我们想向互联网展示我们的平台,并且需要通过我们的代理地址访问我们的WireCloud服务器.现在的问题是,不是代理URL被用作重定向URL,而是内部服务器URL.这会导致错误{"state": "eCUfYmpXnDV34IVR1P8Vtt2Ke8Xhoxtm", "error": "mismatching_redirect_uri"} (HTTP 400)
.
We want to show our platform to the internet and need to address our WireCloud server via our proxy. The problem now is, that not the proxy url gets used as redirect url but the internal server url. This leads to the error {"state": "eCUfYmpXnDV34IVR1P8Vtt2Ke8Xhoxtm", "error": "mismatching_redirect_uri"} (HTTP 400)
.
推荐答案
将以下行添加到settings.py
文件中:
Add the following lines into the settings.py
file:
USE_X_FORWARDED_HOST = True
USE_X_FORWARDED_PORT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
这将配置WireCloud以信任以下标头:X-Forwarded-Host
,X-Forwarded-Port
和X-Forwarded-Proto
.这些标头通常是由代理服务器在调用后端服务时提供的.
this will configure WireCloud to trust the following headers: X-Forwarded-Host
, X-Forwarded-Port
and X-Forwarded-Proto
. These headers are usually provided by the proxy servers when calling the backend service.
如果您不想不依赖这些标头,则可以使用以下设置来设置settings.py
文件中的特定值:
If you prefer to no rely on these headers, you can set the specific values in the settings.py
file using the following settings instead:
FORCE_PROTO = 'https'
FORCE_DOMAIN = 'my.domain.com'
FORCE_PORT = 8000
这篇关于使用代理的WireCloud重定向URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!