Table of Content
response header
- Add response header to the response
add_header <KEY> <VALUE>
request header for proxied server
- Add request header for proxied server
put this into server/location directive.
proxy_add_header <KEY> <VALUE>
related: $host
: in this order of precedence,
- host name from the request line
- host name from the “Host” request header field
- the server name matching a request
plugin virtual servers into main NGINX config
- When installing from NGINX’s official repository, the line will read
include /etc/nginx/conf.d/*.conf;
just as you can see in the http block placed above. Every website hosted with NGINX should feature a unique configuration file in/etc/nginx/conf.d/
, and the name will be formatted as example.com.conf.Those sites that have been disabled — not served by NGINX — should be titled example.com.conf.disabled. - When installing NGINX from the Ubuntu or Debian repositories, the line will read:
include /etc/nginx/sites-enabled/*;
. The../sites-enabled/
folder will include symlinks to the site configuration files located within/etc/nginx/sites-available/
. You can disable sites within sites-available if you take out the symlink to sites-enabled. - According to the installation source, an illustrative configuration file can be found at
/etc/nginx/conf.d/default.conf
oretc/nginx/sites-enabled/default
.