Domain name in multi-tier setups #272
-
Is it somehow possible to access Couper's actual domain name even when operating in a multi-tier setup? So far I have: set_response_headers = {
Set-Cookie = "foo=bar; domain=${request.host}"
} This is fine unless I move Couper behind my SSL offloader as I then of course want the cookie to be set for the offloader's domain. Any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Have a look at couper's run options/environment variables. The variable So in order to get the actual host name in E.g. if the SSL offloader sends If you also want "https" in In a local development setup (without an SSL offloader), you don't set |
Beta Was this translation helpful? Give feedback.
Have a look at couper's run options/environment variables. The variable
COUPER_ACCEPT_FORWARDED_URL
configures, whichX-Forwarded-*
request headers modify the request variablesurl
,origin
,protocol
,host
, andport
.So in order to get the actual host name in
request.host
, setCOUPER_ACCEPT_FORWARDED_URL=host
and make sure that your SSL offloader sends theX-Forwarded-Host
request header.E.g. if the SSL offloader sends
X-Forwarded-Host: www.example.com
,request.host
will be "www.example.com".If you also want "https" in
request.url
,request.origin
andrequest.protocol
, setCOUPER_ACCEPT_FORWARDED_URL=proto,host
and let the SSL offloader sendX-Forwarded-Proto
as well.In a local developme…