2022-01-14 05:25:23 +00:00
|
|
|
Add following labels to `frontend` service
|
2022-01-10 08:40:25 +00:00
|
|
|
|
|
|
|
```yaml
|
2022-02-08 11:45:07 +00:00
|
|
|
traefik.http.routers.custom-domain.rule: Host(`custom.localhost`)
|
|
|
|
# Comment the entrypoints label if traefik already has default entrypoint set
|
|
|
|
traefik.http.routers.custom-domain.entrypoints: web
|
|
|
|
traefik.http.middlewares.custom-domain.headers.customrequestheaders.Host: mysite.localhost
|
|
|
|
traefik.http.routers.custom-domain.middlewares: custom-domain
|
|
|
|
# Add following header only if TLS is needed in case of live server
|
|
|
|
traefik.http.routers.custom-domain.tls.certresolver: main-resolver
|
2022-01-10 08:40:25 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
frontend:
|
2022-01-14 05:25:23 +00:00
|
|
|
...
|
2022-01-10 08:40:25 +00:00
|
|
|
labels:
|
2022-01-14 05:25:23 +00:00
|
|
|
...
|
2022-02-06 16:40:15 +00:00
|
|
|
traefik.http.routers.custom-domain.rule: Host(`custom.localhost`)
|
|
|
|
traefik.http.routers.custom-domain.entrypoints: web
|
|
|
|
traefik.http.middlewares.custom-domain.headers.customrequestheaders.Host: mysite.localhost
|
|
|
|
traefik.http.routers.custom-domain.middlewares: custom-domain
|
|
|
|
traefik.http.routers.custom-domain.tls.certresolver: main-resolver
|
2022-01-14 05:25:23 +00:00
|
|
|
...
|
2022-01-10 08:40:25 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
This will add `custom.localhost` as custom domain for `mysite.localhost`
|