# virtual host for: # {_VHOST_} server { # define listen port listen 80; listen [::]:80; # switch server tokens off - this does not enhance security, but it makes work harder for an attacker server_tokens off; # match all server names for a specific domain with and without subdomain parts server_name {_VHOST_} ; # define document root root /var/www/files; # define logging access_log /var/log/nginx/300_{_VHOST_}_nossl.access_log; error_log /var/log/nginx/300_{_VHOST_}_nossl.error_log warn; # define index files - at least one must be defined index index.html index.htm index; # location for letsencrypt verification location /.well-known { alias /var/www/letsencrypt/.well-known; } location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; autoindex on; } # # # redirect all requests # location / { # # source: http://nginx.org/en/docs/http/converting_rewrite_rules.html # return 301 https://$server_name$request_uri; # } }