From 99b8524c16cc99ceeaf1ebf588f2fc0f2c0fbe0a Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Sat, 12 Oct 2024 08:14:59 -0400 Subject: add a bunch of hostclasses --- files/usr/local/etc/nginx/fastcgi_params.common | 31 ++++++++++++ files/usr/local/etc/nginx/nginx.conf.common | 37 +++++++++++++-- .../local/etc/nginx/vhosts.conf.bitwarden_server | 36 ++++++++++++++ files/usr/local/etc/nginx/vhosts.conf.dav_server | 55 ++++++++++++++++++++++ files/usr/local/etc/nginx/vhosts.conf.smtp_server | 4 +- files/usr/local/etc/nginx/vhosts.conf.ttrss_server | 43 +++++++++++++++++ files/usr/local/etc/nginx/vhosts.conf.xmpp_server | 21 +++++++++ files/usr/local/etc/nginx/vhosts.conf.znc_server | 21 +++++++++ 8 files changed, 241 insertions(+), 7 deletions(-) create mode 100644 files/usr/local/etc/nginx/fastcgi_params.common create mode 100644 files/usr/local/etc/nginx/vhosts.conf.bitwarden_server create mode 100644 files/usr/local/etc/nginx/vhosts.conf.dav_server create mode 100644 files/usr/local/etc/nginx/vhosts.conf.ttrss_server create mode 100644 files/usr/local/etc/nginx/vhosts.conf.xmpp_server create mode 100644 files/usr/local/etc/nginx/vhosts.conf.znc_server (limited to 'files/usr/local/etc/nginx') diff --git a/files/usr/local/etc/nginx/fastcgi_params.common b/files/usr/local/etc/nginx/fastcgi_params.common new file mode 100644 index 0000000..d0a6c69 --- /dev/null +++ b/files/usr/local/etc/nginx/fastcgi_params.common @@ -0,0 +1,31 @@ +fastcgi_param QUERY_STRING $query_string; +fastcgi_param REQUEST_METHOD $request_method; +fastcgi_param CONTENT_TYPE $content_type; +fastcgi_param CONTENT_LENGTH $content_length; + +fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +fastcgi_param SCRIPT_NAME $fastcgi_script_name; +fastcgi_param PATH_INFO $fastcgi_path_info; +fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; +fastcgi_param REQUEST_URI $request_uri; +fastcgi_param DOCUMENT_URI $document_uri; +fastcgi_param DOCUMENT_ROOT $document_root; +fastcgi_param SERVER_PROTOCOL $server_protocol; +fastcgi_param REQUEST_SCHEME $scheme; +fastcgi_param HTTPS $https if_not_empty; + +fastcgi_param GATEWAY_INTERFACE CGI/1.1; +fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; + +fastcgi_param REMOTE_ADDR $remote_addr; +fastcgi_param REMOTE_PORT $remote_port; +fastcgi_param SERVER_ADDR $server_addr; +fastcgi_param SERVER_PORT $server_port; +fastcgi_param SERVER_NAME $host; +fastcgi_param REMOTE_USER $remote_user if_not_empty; + +# PHP only, required if PHP was built with --enable-force-cgi-redirect +fastcgi_param REDIRECT_STATUS 200; + +# Protect against HTTPoxy vuln +fastcgi_param HTTP_PROXY ""; diff --git a/files/usr/local/etc/nginx/nginx.conf.common b/files/usr/local/etc/nginx/nginx.conf.common index 1da7c3c..98ff9f9 100644 --- a/files/usr/local/etc/nginx/nginx.conf.common +++ b/files/usr/local/etc/nginx/nginx.conf.common @@ -33,8 +33,22 @@ http { ssl_session_timeout 1d; ssl_session_cache shared:SSL:10m; ssl_session_tickets off; - ssl_protocols TLSv1.3; - ssl_prefer_server_ciphers off; +$(if [ "${nginx_public:-}" = true ]; then <