Skip to content

Commit 4c0f4d1

Browse files
committed
allow disabling filter mode
1 parent c053503 commit 4c0f4d1

File tree

8 files changed

+34
-3
lines changed

8 files changed

+34
-3
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ services:
4949
FQDN: proxy-pc.demo.com
5050
NUTANIX_ENDPOINT: pc.demo.com
5151
# TRAEFIK_LOG_LEVEL: "info"
52+
#TRAEFIK_LOG_FORMAT: "json"
53+
#TRAEFIK_ACCESSLOG_FORMAT: "json"
5254
# TRAEFIK_SERVERSTRANSPORT_ROOTCAS: /etc/traefik/cert/ca.cer
5355
# DASHBOARD: enable
54-
# TRAEFIK_METRICS_PROMETHEUS: "true"
56+
# TRAEFIK_METRICS_PROMETHEUS: true
57+
# NOFILTER: true
5558
volumes:
5659
- ./cert:/etc/traefik/cert
57-
# - ./auth:/etc/traefik/auth
5860
```
5961
6062
Valid certificate files are required in the file locations below:
@@ -94,6 +96,7 @@ Advanced configuration is possible using the following env variables:
9496
| TRAEFIK_SERVERSTRANSPORT_ROOTCAS | Path of the CA file to validate backend | false | *none* |
9597
| TRAEFIK_SERVERSTRANSPORT_INSECURESKIPVERIFY | Disable SSL certificate verification | false | false |
9698
| TRAEFIK_METRICS_PROMETHEUS | enable metrics export via Prometheus | false | false |
99+
| NOFILTER | disable filter mode | false | false |
97100

98101

99102
## Advanced configuration

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ services:
1616
#TRAEFIK_ACCESSLOG_FORMAT: "json"
1717
# TRAEFIK_SERVERSTRANSPORT_ROOTCAS: /etc/traefik/cert/ca.cer
1818
# DASHBOARD: enable
19-
# TRAEFIK_METRICS_PROMETHEUS="true"
19+
# TRAEFIK_METRICS_PROMETHEUS: true
20+
# NOFILTER: true
2021
volumes:
2122
- ./cert:/etc/traefik/cert
2223
# - ./auth:/etc/traefik/auth

traefik.d/no-filter.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{ if eq (env "NOFILTER") "true" }}
2+
http:
3+
routers:
4+
no-filter:
5+
entryPoints:
6+
- "proxy"
7+
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`/api/nutanix`)"
8+
service: nutanix-pc
9+
priority: 1024
10+
tls: {}
11+
{{ else }}
12+
http:
13+
routers:
14+
filter:
15+
entryPoints:
16+
- "proxy"
17+
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`/api/nutanix`)"
18+
service: noop@internal
19+
priority: 1024
20+
tls: {}
21+
{{end}}
22+

traefik.d/pc-other.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
- "proxy"
3030
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"
3131
service: nutanix-pc
32+
priority: 1111
3233
tls: {}
3334
{{end}}
3435

traefik.d/pc-v1.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- "proxy"
2222
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"
2323
service: nutanix-pc
24+
priority: 1111
2425
tls: {}
2526
{{end}}
2627

traefik.d/pc-v2.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- "proxy"
2222
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"
2323
service: nutanix-pc
24+
priority: 1111
2425
tls: {}
2526
{{end}}
2627

traefik.d/pc-v3.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
- "proxy"
4949
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"
5050
service: nutanix-pc
51+
priority: 1111
5152
tls: {}
5253
{{end}}
5354

traefik.d/pc-v4.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
- "proxy"
7474
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"
7575
service: nutanix-pc
76+
priority: 1111
7677
tls: {}
7778
{{end}}
7879

0 commit comments

Comments
 (0)