Nginx Access-Control-Allow-Origin and CORS

Nginx Access-Control-Allow-Origin header is part of CORS standard (stands for Cross-origin resource sharing) and used to control access to resources located outside of the original domain sending the request.

This standard was created to overcome same-origin security restrictions in browsers, that prevent loading resources from different domains.  …

Continue reading  »

What is nginx server_name and how it works?

Nginx server_name is a special directive used for server block configuration selection. Let say you have multiple server sections in your Nginx config file:

server {
 listen 80;
 server_name test.com;

 ...
}

server {
 listen 80;
 server_name example.com;

 ...
}

When we get incoming request with test.com “Host”  …

Continue reading  »