TheDev
April 24, 2023, 4:44pm
1
I want to remove some of the headers that the fly.io proxy sends.
I want to remove:
the ‘via’ header
the ‘server’ header
the ‘fly-request-id’ header
and the ‘x-powered-by’ header
According to this thread that would be possible by adding a simple line to the fly.toml file:
...
[[services.ports]]
...
http_options = { response = { headers = { via = false, x-powered-by = false, server = false, fly-request-id = false } } }
...
But if I deploy this fly.toml file nothing happens. The headers are still send from the fly.io proxy.
Could be a weird toml thing, I’ve had success with this format (watch your white space)
[services.ports.http_options.response.headers]
Via = false
X-Powered-By = false
(I’m not sure if the Fly Proxy ignores this setting for certain headers, such as the request ID - someone can hopefully answer that if it becomes an issue).
Make sure you’re running a fly deploy
after making any changes here.
1 Like
kurt
April 24, 2023, 5:42pm
3
This may not be implemented properly for machine apps yet.
dangra
April 24, 2023, 6:07pm
4
I am working on porting it atm
2 Likes
TheDev
April 24, 2023, 6:22pm
5
Thanks for your answers!
I will definitely take a look at @fideloper-fly ‘s solution and hope I will have success with it.
I will answer to this topic what my results were.
I would definitely appreciate if fly.io would implement that to work with all headers.
Thanks!
Have a nice day!
dangra
April 24, 2023, 7:07pm
6
dangra
April 24, 2023, 11:32pm
7
Ok, it took longer than expected but here it is, upgrade to flyctl v0.0.541 and redeploy
4 Likes
system
Closed
May 3, 2023, 1:35pm
9
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.