Overview

This is a note on how to operate multiple HTTPS-enabled containers with Traefik.

https://github.com/traefik/traefik

Background

Previously, I was using jwilder/nginx-proxy and jrcs/letsencrypt-nginx-proxy-companion with the following configuration.

Proxy

v#sneeoerprnllchvdtdsrvgeuethhweioiiicplrticd---mrmopofeoxcnmoooaesmoeoetlsaraxnyexanr--l---b-seanp"lcvhss:trkutn:s-gttuetngtenuehtv:::aslea:peas""mhdvc/l"aceangmromam:trm'r:i:84ethhesscrr:idietslr::ne3on04smporar:otynsnsst:a:'xje:3:lastrm:pje_x:::rlywr8::rts//.trro-/uu:c:i_04/a::rdga:c_npeesnoln"4um//uoilsn:rttrmda3s:eenctw/aoccdmem"rtt/khalmx/sooreeccdeuyeeynnhcn/:st//orbst:"ggak_nhcnnc/.siirelgna/ggknjennneriigrniiegrngxx.nniegnnricci/nskxn/ixx.nsrncvgo-xnn/sx.yxehicp-gxco-lp-ronkrpi/hecpetptsx:orndorkrt-rst/xoxhst:sno:.hvyx/ptsxegxrdtayha.:tyniywmrtrdrm-cn-l/maopwrxlrlm/iy-eudtpptnohtrs/c-_o-dkenxeoengyncrci-ck.rncresyxoyrop_mp.ctpptsk/rao:loncroxikogyo::_nr/covoamrp/alnoigo/nn.gnignixnx_proxy"

Container

Below is a Django example.

vsneeerrndtdsvgnweiiiipdesbctwofeocnmooen:uootoraxnexar-lp-vVLLicdl-nyrkutn:s:gtueiIEEloout:kslea:es"mndrRTTdncm"ai:trm"::1ednoTSS:tke.itn:ne38sd.ssnUEEees.nrga:"n0:eh_mANNxr:/eu_lg0ftoeLCCtfwred:ci1apnn_RR:ie_ion:ua:tHYYlbnrmx8ls:OPPe:a:m:0tsSTT:/mol".wT__me"nacd:HEy:/_to:OM/smlen/dSAdidyisfejTIotnsnt:ta:Lcesik/cn:k"te/gdeetnojxr"cg.ax//iynxDnnygogxyoci/..kn.zyexhzyr/tzyfcp.ioazlnszefsz.wdd/default.conf

For adding Basic Authentication, I was using nginx:latest in addition to Django.

!

The following library might have been an easier approach.

https://pypi.org/project/wsgi-basic-auth/

Using Traefik

With Traefik, the configuration changed to the following.

Proxy

sneertttvrwriaicrpneloaecemoeoenaorexefansr--t-vTbttttttlkftsigtttwiZerrrrrrusie:keaas48otr:laaaaaam:kr::ir:40rroseeeeeeev/-nnt3:kanA:ffffffsaltnate::8semsiiiiii:rerelrr40:feikkkkkk/tat:a_a4ina......rsewenl3kt/ehhhhhuefotfaw-:Tntttttnnirrimanoattttt/ckkukeyekbpppppdr.:e::styl.....oyylwoerrrrmcpmato:ooooiktltrruuuude::eaktttttdr/sereeeel.letfurrrresetiesssswotck....acs/ddddrketaaaae:nrsssss/cahhhh.vrebbbbaayfoooourpiaaaat/tkrrrrhr/dddd.ut....bnrretma/aunlisdeltsdiofer.dcci:yclakkpeeue.Horwtryoitah.msnrr.sltteeuo:(sssscr`:o:ekoplr:rwvasroeeu:oxbrtys:hx.exycmxyuyxyrrx.eexzsxzoxzlx`v)er
leapconpreg#twwidodrm:ree:avotylybahbasiceiraeP:dtsdhdkxfecvodtredbeepismesc#heirpecrorrocoemtatlne:deueas:sal:aoScte:tsinrsr:etvireapnssrttspesddeelarSCtD::eroce:::Bsr:gvehrEcy:hryR:eerayB:tPem:tDea:rvlPU8iowma4resa:eloG0oiean4ufoa/reinnb:e3eal@ah:nnstsnuvbctgt::ehtlebmthe:ct:trbept:ut:s.stwrpt:j:peesrfssbua/:elna/sc/emaec-mve0-2s.taapgii.nlge-tvs0e2n.carpyip.tl.eotrsge/ndcirryepctt.oorryg/directory

Container

Traefik middleware is used to implement Basic Authentication.

sneerdttvnwrisbpctwnrloaec:uoootoeearexeicdl-r-nyrt-sbttttttkftslooutt:kwterrrrrrsie:dncm"s"aiotalaaaaaa:kr:tke.:1itnrrrseeeeee-nees.8nrgkat:ffffffnaxr:/0eu_se:iiiiiieltfw0red:fkkkkkkt::ie1_iia......wlb:nrklehhhhhote:8a:-wntttttrr:/0mnaatttttkum0e"eybppppp:ey0:/tsl...../s"mwerrrrmdidyo:ooooiotnsruuuudcesiktttttdk"treeeeleeurrrrer"essssw/....aDddddronnnnecsssssk.....eretmdrunlinfltsdsier.d.l:yclbepeeaHorwsoitaisnrrctteea(sssu`:o:tdlhjwvd.aeenunbrssgs:eoer.cmsyuy:yrryeex.sxzoxzlxzvx`ex)rxxx

By creating this configuration for each container, you can operate multiple containers in a similar environment.

Summary

There may be misunderstandings or insufficient considerations, but I hope this is helpful as a method for operating multiple HTTPS-enabled containers (with Basic Authentication).