diff --git a/web/redirect-root/docker-compose.yml b/web/redirect-root/docker-compose.yml new file mode 100644 index 0000000..4c73a19 --- /dev/null +++ b/web/redirect-root/docker-compose.yml @@ -0,0 +1,21 @@ +services: + redirect-root: + image: nginx:alpine + container_name: redirect-root + volumes: + - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro + networks: + - frontend + labels: + - "traefik.enable=true" + + # 根路径重定向 - 最高优先级 + - "traefik.http.routers.redirect-root.rule=Host(`amiap.hzau.edu.cn`) && Path(`/`)" + - "traefik.http.routers.redirect-root.priority=200" + - "traefik.http.routers.redirect-root.entrypoints=websecure" + - "traefik.http.routers.redirect-root.tls.certresolver=myresolver" + - "traefik.http.services.redirect-root-svc.loadbalancer.server.port=80" + +networks: + frontend: + external: true diff --git a/web/redirect-root/nginx.conf b/web/redirect-root/nginx.conf new file mode 100644 index 0000000..5820071 --- /dev/null +++ b/web/redirect-root/nginx.conf @@ -0,0 +1,8 @@ +server { + listen 80; + server_name _; + + location = / { + return 302 /group/; + } +}