Skip to content

tmagnien/nginx-filter-headers-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Name

ngx_filter_headers - Filters output headers based on whitelist

Table of Contents

  • [Name] (#name)
  • [Synopsis] (#synopsis)
  • [Description] (#description)
  • [Directives] (#directives)
    • [filter_headers_output_whitelist] (#filter_headers_output_whitelist)
  • [Installation] (#installation)
  • [TODO] (#todo)
  • [Author] (#author)

Synopsis

 # clear all headers not present in given list before sending response to client
 location /somewhere {
     filter_headers_output_whitelist vary content-length last-modified connection accept-ranges content-type content-encoding etag cache-control expires keep-alive accept-ranges server;
     proxy_pass http://origin_server;
 }

Description

This module allows you to give the list of headers that will be sent to client. Any header not in this list will be cleared before response is sent.

Directives

filter_headers_output_whitelist

syntax: filter_headers_output_whitelist <header> ... <header>

default: no

context: http, server, location, location if

phase: output-header-filter

Clears any header not in given list from response to client.

Installation

Grab the nginx source code from nginx.org and then build the source with this module:

 wget 'http://nginx.org/download/nginx-1.10.1.tar.gz'
 tar -xzvf nginx-1.10.1.tar.gz
 cd nginx-1.10.1/
 
 ./configure --add-module=/path/to/nginx-filter-headers-module

 make
 make install

TODO

  • Support clearing headers from origin server response before the object gets cached

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages