Ask Your Question
0

How can I set X-Forwarded-Proto header for a reverse proxy when using puppetlabs/apache?

asked 2016-08-17 05:45:46 -0500

amoe gravatar image

Hi there, I use puppetlabs/apache to manage my Apache server, and the proxy options work well for me. Because I need to form links in the backend based on the protocol (http or https), I want to pass the de-facto standardX-Forwarded-Proto header to the backend. But, the only available option to set these headers, Apache's built in ProxyAddHeaders directive, which is implemented in puppetlabs/apache by proxy_add_headersattribute, does not set X-Forwarded-Proto, but only sets some other X-Forwarded-* headers.

Is there a way in the apache module that I can set this custom header?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-08-17 06:05:39 -0500

amoe gravatar image

Seems obvious in retrospect, but you just specify a custom request header to the vhost as usual.

request_headers => [
    'set X-Forwarded-Proto "https"'
]

Because the SSL host will be a different resource in any case, you just specify the static value inside the SSL and non-SSL hosts.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-08-17 05:45:46 -0500

Seen: 346 times

Last updated: Aug 17 '16