diff options
author | crupest <crupest@outlook.com> | 2024-11-11 01:12:29 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-01-20 23:24:41 +0800 |
commit | 90a72d2d7ed4a5eadfe36f62d81f26ca3324e49b (patch) | |
tree | 0e5241878de3fc7cd36e4e5bcd2eac3ae1b063f6 /templates/nginx | |
parent | 907eff64f175822e1113887a8b547490dadf9687 (diff) | |
download | crupest-90a72d2d7ed4a5eadfe36f62d81f26ca3324e49b.tar.gz crupest-90a72d2d7ed4a5eadfe36f62d81f26ca3324e49b.tar.bz2 crupest-90a72d2d7ed4a5eadfe36f62d81f26ca3324e49b.zip |
HALF WORK: 2024.1.20 - 4
Diffstat (limited to 'templates/nginx')
-rw-r--r-- | templates/nginx/common/http-listen | 2 | ||||
-rw-r--r-- | templates/nginx/common/https-listen | 3 | ||||
-rw-r--r-- | templates/nginx/conf.d/2fa.conf.template (renamed from templates/nginx/2fa.conf.template) | 6 | ||||
-rw-r--r-- | templates/nginx/conf.d/code.conf.template (renamed from templates/nginx/code.conf.template) | 6 | ||||
-rw-r--r-- | templates/nginx/conf.d/forbid_unknown_domain.conf (renamed from templates/nginx/forbid_unknown_domain.conf) | 5 | ||||
-rw-r--r-- | templates/nginx/conf.d/git.conf.template (renamed from templates/nginx/git.conf.template) | 6 | ||||
-rw-r--r-- | templates/nginx/conf.d/mail.conf.template (renamed from templates/nginx/mail.conf.template) | 6 | ||||
-rw-r--r-- | templates/nginx/conf.d/root.conf.template (renamed from templates/nginx/root.conf.template) | 6 | ||||
-rw-r--r-- | templates/nginx/conf.d/ssl.conf.template (renamed from templates/nginx/ssl.conf.template) | 0 | ||||
-rw-r--r-- | templates/nginx/conf.d/timeline.conf.template (renamed from templates/nginx/timeline.conf.template) | 3 | ||||
-rw-r--r-- | templates/nginx/conf.d/websocket.conf (renamed from templates/nginx/websocket.conf) | 0 |
11 files changed, 19 insertions, 24 deletions
diff --git a/templates/nginx/common/http-listen b/templates/nginx/common/http-listen new file mode 100644 index 0000000..76cb18d --- /dev/null +++ b/templates/nginx/common/http-listen @@ -0,0 +1,2 @@ +listen 80; +listen [::]:80; diff --git a/templates/nginx/common/https-listen b/templates/nginx/common/https-listen new file mode 100644 index 0000000..db2f68e --- /dev/null +++ b/templates/nginx/common/https-listen @@ -0,0 +1,3 @@ +listen 443 ssl; +listen [::]:443 ssl; +http2 on; diff --git a/templates/nginx/2fa.conf.template b/templates/nginx/conf.d/2fa.conf.template index aad66c1..278e4a1 100644 --- a/templates/nginx/2fa.conf.template +++ b/templates/nginx/conf.d/2fa.conf.template @@ -1,7 +1,6 @@ server { - listen 443 ssl http2; - listen [::]:443 ssl http2; server_name 2fa.${CRUPEST_DOMAIN}; + include common/https-listen; location / { include common/proxy-common; @@ -10,9 +9,8 @@ server { } server { - listen 80; - listen [::]:80; server_name 2fa.${CRUPEST_DOMAIN}; + include common/http-listen; include common/https-redirect; include common/acme-challenge; diff --git a/templates/nginx/code.conf.template b/templates/nginx/conf.d/code.conf.template index a67500d..205c7ba 100644 --- a/templates/nginx/code.conf.template +++ b/templates/nginx/conf.d/code.conf.template @@ -1,7 +1,6 @@ server { - listen 443 ssl http2; - listen [::]:443 ssl http2; server_name code.${CRUPEST_DOMAIN}; + include common/https-listen; location / { include common/proxy-common; @@ -13,9 +12,8 @@ server { server { - listen 80; - listen [::]:80; server_name code.${CRUPEST_DOMAIN}; + include common/http-listen; include common/https-redirect; include common/acme-challenge; diff --git a/templates/nginx/forbid_unknown_domain.conf b/templates/nginx/conf.d/forbid_unknown_domain.conf index ae96393..515942b 100644 --- a/templates/nginx/forbid_unknown_domain.conf +++ b/templates/nginx/conf.d/forbid_unknown_domain.conf @@ -1,8 +1,9 @@ server { listen 80 default_server; listen [::]:80 default_server; - listen 443 ssl http2 default_server; - listen [::]:443 ssl http2 default_server; + listen 443 ssl default_server; + listen [::]:443 ssl default_server; + http2 on; return 444; } diff --git a/templates/nginx/git.conf.template b/templates/nginx/conf.d/git.conf.template index ea2a627..3a2948c 100644 --- a/templates/nginx/git.conf.template +++ b/templates/nginx/conf.d/git.conf.template @@ -1,7 +1,6 @@ server { - listen 443 ssl http2; - listen [::]:443 ssl http2; server_name git.${CRUPEST_DOMAIN}; + include common/https-listen; location / { include common/proxy-common; @@ -13,9 +12,8 @@ server { server { - listen 80; - listen [::]:80; server_name git.${CRUPEST_DOMAIN}; + include common/http-listen; include common/https-redirect; include common/acme-challenge; diff --git a/templates/nginx/mail.conf.template b/templates/nginx/conf.d/mail.conf.template index ba2e44e..40adf28 100644 --- a/templates/nginx/mail.conf.template +++ b/templates/nginx/conf.d/mail.conf.template @@ -1,7 +1,6 @@ server { - listen 443 ssl http2; - listen [::]:443 ssl http2; server_name mail.${CRUPEST_DOMAIN}; + include common/https-listen; location / { include common/proxy-common; @@ -18,9 +17,8 @@ server { server { - listen 80; - listen [::]:80; server_name mail.${CRUPEST_DOMAIN}; + include common/http-listen; include common/https-redirect; include common/acme-challenge; diff --git a/templates/nginx/root.conf.template b/templates/nginx/conf.d/root.conf.template index 3f20cf1..a0b08f8 100644 --- a/templates/nginx/root.conf.template +++ b/templates/nginx/conf.d/root.conf.template @@ -1,7 +1,6 @@ server { - listen 443 ssl http2; - listen [::]:443 ssl http2; server_name ${CRUPEST_DOMAIN}; + include common/https-listen; location / { root /srv/www; @@ -19,9 +18,8 @@ server { } server { - listen 80; - listen [::]:80; server_name ${CRUPEST_DOMAIN}; + include common/http-listen; include common/https-redirect; include common/acme-challenge; diff --git a/templates/nginx/ssl.conf.template b/templates/nginx/conf.d/ssl.conf.template index 54205f1..54205f1 100644 --- a/templates/nginx/ssl.conf.template +++ b/templates/nginx/conf.d/ssl.conf.template diff --git a/templates/nginx/timeline.conf.template b/templates/nginx/conf.d/timeline.conf.template index db908e8..a467594 100644 --- a/templates/nginx/timeline.conf.template +++ b/templates/nginx/conf.d/timeline.conf.template @@ -1,7 +1,6 @@ server { - listen 80; - listen [::]:80; server_name timeline.${CRUPEST_DOMAIN}; + include common/http-listen; include common/acme-challenge; } diff --git a/templates/nginx/websocket.conf b/templates/nginx/conf.d/websocket.conf index 32af4c3..32af4c3 100644 --- a/templates/nginx/websocket.conf +++ b/templates/nginx/conf.d/websocket.conf |