@@ -71,15 +71,23 @@ To configure traefik to use let's encrypt, first we need to register a [certific
71
71
``` toml
72
72
# static configuration
73
73
74
- # need an http endpoint, not just https
75
- [entrypoints .http ]
74
+ # redirect all http requests to https
75
+ [entrypoints .httponly ]
76
76
address = " :80"
77
+ [entryPoints .httponly .http .redirections .entryPoint ]
78
+ to = " https"
79
+ scheme = " https"
77
80
78
- [certificateResolvers .letsencrypt .acme ]
81
+ # configure
82
+ [certificatesResolvers .letsencrypt .acme ]
79
83
80
84
storage = " acme.json" # file where certificates are stored
81
- [certificateResolvers .letsencrypt .acme .httpChallenge ]
82
- entryPoint = " http"
85
+ # use the staging server to test your deployment
86
+ # uncomment this when you are ready for production
87
+ caServer = " https://acme-staging-v02.api.letsencrypt.org/directory"
88
+
89
+ # tlsChallenge means you don't need an http endpoint
90
+ [certificatesResolvers .letsencrypt .acme .tlsChallenge ]
83
91
```
84
92
85
93
And in your extra dynamic configuration, specify the domain(s) you want certificates for:
@@ -110,22 +118,19 @@ c.TraefikProxy.extra_static_config = {
110
118
" http" : {
111
119
" tls" : {
112
120
" options" : " default"
113
- }
114
- }
121
+ },
122
+ },
115
123
},
116
124
},
117
- " certificateResolvers " : {
125
+ " certificatesResolvers " : {
118
126
" letsencrypt" : {
119
127
" acme" : {
120
128
121
129
" storage" : " acme.json" ,
122
130
},
123
- " httpChallenge" : {
124
- " entryPoint" : " https"
125
- }
126
- }
127
-
128
- }
131
+ " tlsChallenge" : {},
132
+ },
133
+ },
129
134
}
130
135
131
136
@@ -137,10 +142,10 @@ c.TraefikProxy.extra_dynamic_config = {
137
142
" resolver" : " letsencrypt" ,
138
143
" domain" : {
139
144
" main" : " hub.example.com" ,
140
- }
141
- }
142
- }
143
- }
145
+ },
146
+ },
147
+ },
148
+ },
144
149
},
145
150
}
146
151
```
0 commit comments