2
0

Minor webservice enhancements

* forced text/html MIME type to the nginx.conf static messages
* preparation of a static web service in nginx.conf
* preparation of static certificates in configs folder and nginx.conf
* missing } in nginx.conf
This commit is contained in:
2025-02-02 18:26:25 +01:00
parent 0547b81062
commit 125466cf1e
4 changed files with 28 additions and 4 deletions

View File

@ -30,8 +30,10 @@ server {
# return 301 https://$host$request_uri;
# }
# Webapp's configuration.
# Extended character set.
charset utf-8;
# Webapp's configuration.
location /$PAR_LOCATION {
proxy_pass http://$PAR_PROXYHOST:$PAR_PROXYPORT/$PAR_LOCATION;
error_page 500 502 503 504 @proxy_error;
@ -57,18 +59,29 @@ server {
proxy_set_header Connection "upgrade";
}
location @proxy_error {
default_type text/html;
types { } default_type text/html;
return 500
"<span style='font-size: x-large'>Sorry something went wrong. Try again a bit later.<br>
You may report this at <a href='mailto:$server_admin'>$server_admin</a>.</span>";
}
#
# Static service.
# location / {
# root $PAR_SERVICE/storage/volumes/staticweb/;
# allow all;
# autoindex off;
# index index.html index.htm;
# try_files $ri $uri/ =404;
# }
#
# No static service, but we may provide the OPTIONS for a potential DAV client.
# location / {
# default_type text/html;
# types { } default_type text/html;
## dav_ext_methods OPTIONS;
# if ($request_method != OPTIONS) {
# return 404 "<span style='font-size: x-large'>Sorry try <a href='$scheme://$server_name/$PAR_LOCATION'>$scheme://$server_name/$PAR_LOCATION</a> instead.</span>";
## return 302 $scheme://$server_name/$PAR_LOCATION;
# }
# }
##################################################################################
@ -76,8 +89,12 @@ server {
# https://ssl-config.mozilla.org/
# https://community.letsencrypt.org/t/howto-a-with-all-100-s-on-ssl-labs-test-using-nginx-mainline-stable/55033
# For an ACME-handled certificate.
# ssl_certificate $PAR_SERVICE/configs/acme/$PAR_SERVERNAME/fullchain.cer;
# ssl_certificate_key $PAR_SERVICE/configs/acme/$PAR_SERVERNAME/$PAR_SERVERNAME.key;
# For a (possibly symlinked) static certificate.
# ssl_certificate $PAR_SERVICE/configs/certs/$PAR_SERVERNAME/fullchain.cer;
# ssl_certificate_key $PAR_SERVICE/configs/certs/$PAR_SERVERNAME/$PAR_SERVERNAME.key;
# Settings to achieve 'A' grade on https://www.ssllabs.com/ssltest/
ssl_session_timeout 1440m;