summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2025-01-01 11:45:58 +0100
committerHolger Weiss <holger@zedat.fu-berlin.de>2025-01-01 11:45:58 +0100
commit7dfac6e873f0d907ff5c8bcd1d7d37909bac2806 (patch)
tree8e464a28cd9bcf393ddb2c4a4c7ede05a1919e54 /etc
parent78c2d2c599bc358446cd5deb667f6e78e77b8024 (diff)
downloadsite-master.tar.gz
Nginx: Always add "www" prefix to domainHEADmaster
Offering the same contents under two domains can be bad for search engine ranking. Personally I'd prefer omitting the "www", but doing that might break e.g. Mailman's virtual hosting, so we'd have to check things first.
Diffstat (limited to 'etc')
-rw-r--r--etc/nginx.conf21
1 files changed, 20 insertions, 1 deletions
diff --git a/etc/nginx.conf b/etc/nginx.conf
index 1a6687f..f8e61bf 100644
--- a/etc/nginx.conf
+++ b/etc/nginx.conf
@@ -21,7 +21,7 @@ ssl_dhparam /home/plugins/etc/ssl/dh-parameters.pem;
21server { 21server {
22 listen 130.133.8.40:443 ssl http2; 22 listen 130.133.8.40:443 ssl http2;
23 listen 130.133.8.40:444 ssl http2; 23 listen 130.133.8.40:444 ssl http2;
24 server_name monitoring-plugins.org www.monitoring-plugins.org; 24 server_name www.monitoring-plugins.org;
25 root /home/plugins/web/port-$server_port; 25 root /home/plugins/web/port-$server_port;
26 ssl_certificate /home/plugins/etc/ssl/monitoring-plugins.crt; 26 ssl_certificate /home/plugins/etc/ssl/monitoring-plugins.crt;
27 ssl_certificate_key /home/plugins/etc/ssl/monitoring-plugins.key; 27 ssl_certificate_key /home/plugins/etc/ssl/monitoring-plugins.key;
@@ -149,6 +149,25 @@ server {
149} 149}
150 150
151# 151#
152# Add "www" prefix. Ditto for the test instance.
153#
154server {
155 listen 130.133.8.40:443 ssl http2;
156 server_name monitoring-plugins.org;
157 ssl_certificate /home/plugins/etc/ssl/monitoring-plugins.crt;
158 ssl_certificate_key /home/plugins/etc/ssl/monitoring-plugins.key;
159 return 301 https://www.monitoring-plugins.org$request_uri;
160}
161
162server {
163 listen 130.133.8.40:444 ssl http2;
164 server_name monitoring-plugins.org;
165 ssl_certificate /home/plugins/etc/ssl/monitoring-plugins.crt;
166 ssl_certificate_key /home/plugins/etc/ssl/monitoring-plugins.key;
167 return 301 https://www.monitoring-plugins.org:444$request_uri;
168}
169
170#
152# Outdated domains. Can be deleted in 2026. 171# Outdated domains. Can be deleted in 2026.
153# 172#
154server { 173server {