Caddy: Missing proxy headers

Created on 25 Apr 2017  路  2Comments  路  Source: caddyserver/caddy

1. What version of Caddy are you running (caddy -version)?

Caddy 0.10.0

2. What are you trying to do?

Set some header_upstream headers

3. What is your entire Caddyfile?

demo.raggaer.pw {
    tls [email protected]
    proxy / http://localhost:8080 {
        transparent
    }
}

4. How did you run Caddy (give the full command and describe the execution environment)?

caddy -conf /home/caddy/CaddyFile

5. Please paste any relevant HTTP request(s) here.

curl https://demo.raggaer.pw

6. What did you expect to see?

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Date: Mon, 24 Apr 2017 22:36:51 GMT
Referrer-Policy: origin
Server: Caddy
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-Xss-Protection: 1; mode=block
Transfer-Encoding: chunked
X-Forwarded-For: XXXX

7. What did you see instead (give full error messages and/or log)?

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Date: Mon, 24 Apr 2017 22:36:51 GMT
Referrer-Policy: origin
Server: Caddy
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-Xss-Protection: 1; mode=block
Transfer-Encoding: chunked

The X-Forwarded-For header is not present even tho I am using the transparent preset. I am missing something?

Most helpful comment

Thanks and sorry for the misunderstanding!

All 2 comments

I think this is a misunderstanding in what upstream headers are. Those headers are added along with the incoming request to the proxied server, they aren't returned in the response back to the browser (unless the proxied server mirrors them back or something).

If you're looking to add headers in the response coming back, use header_downstream instead.

Thanks and sorry for the misunderstanding!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

treviser picture treviser  路  3Comments

billop picture billop  路  3Comments

dafanasiev picture dafanasiev  路  3Comments

kilpatty picture kilpatty  路  3Comments

SteffenDE picture SteffenDE  路  3Comments