redirect nginx

This commit is contained in:
zly
2025-11-23 17:45:27 +08:00
parent 9bdc52b2dd
commit 276856e38a
2 changed files with 29 additions and 0 deletions

View File

@@ -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

View File

@@ -0,0 +1,8 @@
server {
listen 80;
server_name _;
location = / {
return 302 /group/;
}
}