Skip to content

NGINX Quick reference

HaymonEdmur edited this page Jun 25, 2018 · 3 revisions

NGINX Quick Reference


Check configuration

nginx -t 
  • nginx -T dumps all configuration of nginx.conf and include files from conf.d directory

location directive for static pages

 server {
    listen 82;
    listen [::]:82;
    root /var/www;

    location / {
       # page = /usr/share/nginx/html/index.html
       # http://host:82
       root /usr/share/nginx/html;
    }

    location /site1 {
       # page = /var/www/braintree/site1/index.html
       # http://host:82/site1
       root /var/www/braintree;
       index index.html;
    }
    location /site2 {
       # page = /var/www/braintree/site2/index.html
       # http://host:82/site2
       root /var/www/braintree;
       index index.html;
    }

    location /site3 {
       # page = /var/www/site3/index.html
       # http://host:82/site3
       # Shares root of server defined at the beginning /var/www
       index index.html;
    }
}