Skip to content

Feature Request: Option to use more_set_headers instead of add_header #228

@realrellek

Description

@realrellek

Hello,

this is going to be sort of a bug report.

Here's the issue. If you are setting headers in your vhost (in the server {} block), rocket-nginx will overwrite them with its status report headers (if the cache was a HIT, a MISS, or a BYPASS). This is due to how nginx works; it will get its information from the location block that fits best, and if it contains an add_header, it will dismiss all add_headers that might also match on the levels above.

So say you had HTST in your vhost, it's gone when rocket-nginx sends its status report.

My proposed fix is to use more_set_headers instead as this will not make nginx forget headers that are meant to be sent from the level above.

The problem is that it is not a core feature of nginx. On Debian-bases systems, it's the package libnginx-mod-http-headers-more-filter, and it's also included in nginx-extras. That might differ in other distros.

However, I'd say it's a good call to make the admin aware of this, suggest to install it and set a switch to true. Said switch would use more_set_headers instead of add_header.

I've prepared a PR that implements this.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    details neededPlease clarify the situation by adding details.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions