Skip to content

thylacine/nginx-http-headers-static-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ngx_headers_static

Inject headers from a file when serving content

This module is not distributed with the Nginx source.

Description

This module allows for the inclusion of arbitrary response headers from a static file for the corresponding content file being served, in a way reminiscent of CERN-style metafiles.

Limited validation is done on the included headers.

Header files should consist of headers in standard form:

 X-Extra-Header: some data

Configuration

 location /foo {
  # enable static header injection for a location
  static_headers on;

  # where to find header file, relative to content file
  static_headers_path .web; # default is .web directory

  # how are header files named
  static_headers_suffix .meta; # default is .meta

  # with these values set, a request for content.txt would include any
  # headers from .web/content.txt.meta
 }

About

A simple module to let nginx serve additional headers from metadata files, similar to apache's mod_cern_meta.

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Contributors

Languages