added LE processing, updated error pages

This commit is contained in:
Asif Bacchus 2019-01-04 03:00:07 -07:00
parent 88663dd4bb
commit 8b5f923949
2 changed files with 55 additions and 0 deletions

View File

@ -12,4 +12,17 @@ server {
# redirect to properly formed HTTPS request
return 301 https://$host$request_uri;
# error pages
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
internal;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
internal;
}
}

View File

@ -0,0 +1,42 @@
#######
### NGINX server configuration
### Redirect to secure connection
### Process LetsEncrypt verification requests
#######
server {
listen 80;
listen [::]:80;
# specify server name(s)
include /etc/nginx/snippets/server_names.conf;
# redirect to properly formed HTTPS request
location / {
return 301 https://$host$request_uri;
}
# process LetsEncrypt requests
location ^~ /.well-known/acme-challenge {
# log requests to review issued certs or for security auditing
access_log /var/log/nginx/LetsEncrypt_access.log main;
error_log /var/log/nginx/LetsEncrypt_error.log warn;
default_type text/plain;
root /usr/share/nginx/html/letsencrypt;
autoindex on;
}
# error pages
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
internal;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
internal;
}
}