1

I am proxying apache requests to s3 and I want to rewrite the response header into a new crafted header

this is my configuration:

SetEnvIf x-amz-meta-link "(.*)" DYN_CSS=$0
Header set Link "</static_assets/stylesheets/application-%{DYN_CSS}e.css>; rel=preload; as=stylesheet" env=DYN_CSS

s3 Header is configured to be x-amz-meta-link: css

I am expecting the header in the final response to be

 </static_assets/stylesheets/application-css.css>; rel=preloadas=stylesheet" 

but what I get is (empty var)

</static_assets/stylesheets/application-.css>; 

1 Answer 1

4

If you are using version 2.4.10+ you can use: I would suggest using the "expr=..." form of the Header directive and using %{resp:x-amz-meta-link} to get the response header value

SetEnvIf only reads request headers, runs before response headers are available, etc.

Sign up to request clarification or add additional context in comments.

3 Comments

I am trying Header set foo "expr=%{resp:x-amz-meta-link}e", but I am getting foo: expr=(null)
I also tried Header set foo "expr=%{resp:x-amz-meta-link}" but this doesn't even pass the apache reload

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.