init: initial commit

This commit is contained in:
thehrz 2023-11-04 22:09:58 +08:00
commit dbcde8c5be
Signed by: thehrz
GPG Key ID: C84CBCE7D5F88855
5 changed files with 47 additions and 0 deletions

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM nginx:1.19
WORKDIR /nginx
COPY ./nginx/conf.d /etc/nginx/conf.d

20
docker-compose.yml Normal file
View File

@ -0,0 +1,20 @@
version: "3.8"
networks:
traefik:
name: traefik
external: true
services:
nginx:
build: .
container_name: hfbz-nginx
restart: always
labels:
- traefik.enable=true
- traefik.http.routers.hfbz-nginx.rule=Host(`xn--fiqa592br0dm3gfp6c.com`, `www.xn--fiqa592br0dm3gfp6c.com`)
- traefik.http.routers.hfbz-nginx.entrypoints=web,websecure
- traefik.http.routers.hfbz-nginx.tls.certresolver=letsencrypt
- traefik.http.routers.hfbz-nginx.middlewares=CORS@file
networks:
- traefik

View File

@ -0,0 +1,6 @@
server {
listen 80;
listen [::]:80;
return 403;
}

9
nginx/conf.d/root.conf Normal file
View File

@ -0,0 +1,9 @@
server {
listen 80;
listen [::]:80;
server_name xn--fiqa592br0dm3gfp6c.com;
location / {
rewrite ^/(.*) https://www.hfbz.com/ permanent;
}
}

9
nginx/conf.d/www.conf Normal file
View File

@ -0,0 +1,9 @@
server {
listen 80;
listen [::]:80;
server_name www.xn--fiqa592br0dm3gfp6c.com
location / {
rewrite ^/(.*) https://www.hfbz.com/ permanent;
}
}