From c4e49108c9e9aebd64180754fce5cb89f72eb62f Mon Sep 17 00:00:00 2001 From: thehrz Date: Sat, 5 Aug 2023 14:06:39 +0800 Subject: [PATCH] pref: update nginx config --- nginx/conf.d/default.conf | 6 ++++++ nginx/conf.d/root.conf | 5 ++--- nginx/conf.d/www.conf | 10 ++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 nginx/conf.d/default.conf create mode 100644 nginx/conf.d/www.conf diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf new file mode 100644 index 0000000..87f6c95 --- /dev/null +++ b/nginx/conf.d/default.conf @@ -0,0 +1,6 @@ +server { + listen 80; + listen [::]:80; + + return 403; +} \ No newline at end of file diff --git a/nginx/conf.d/root.conf b/nginx/conf.d/root.conf index 50d44c9..43d9bf8 100644 --- a/nginx/conf.d/root.conf +++ b/nginx/conf.d/root.conf @@ -1,10 +1,9 @@ server { listen 80; listen [::]:80; - server_name test.thehrz.net; + server_name 19yuke2.cn; location / { - root /usr/local/nginx/html/; - try_files $uri $uri/ /index.html; + return 301 https://www.19yuke2.cn; } } \ No newline at end of file diff --git a/nginx/conf.d/www.conf b/nginx/conf.d/www.conf new file mode 100644 index 0000000..295729e --- /dev/null +++ b/nginx/conf.d/www.conf @@ -0,0 +1,10 @@ +server { + listen 80; + listen [::]:80; + server_name www.19yuke2.cn; + + location / { + root /usr/local/nginx/html/; + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file