Adding and using header (HTTP) in nginx [closed]

To add a header, add the add_header declaration to either the location block or the server block:

server {
   add_header X-server-header "my server header content!";
   location /specific-location {
       add_header X-location-header "my specific-location header content!";
   }
}

An add_header declaration within a location block will override the same add_header declaration in the outer server block.
e.g. if location contained add_header X-server-header ... that would override the outer declaration for that path location.

Obviously, replace the values with what you want to add. And that’s all there is to it.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)