redirect nginx
This commit is contained in:
21
web/redirect-root/docker-compose.yml
Normal file
21
web/redirect-root/docker-compose.yml
Normal 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
|
||||||
8
web/redirect-root/nginx.conf
Normal file
8
web/redirect-root/nginx.conf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
location = / {
|
||||||
|
return 302 /group/;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user