# 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/offline; # 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; } # redirect all requests location / { # source: http://nginx.org/en/docs/http/converting_rewrite_rules.html return 301 https://$server_name$request_uri; } }