# Discourse with Traefik 2.0

**URL:** https://meta.discourse.org/t/discourse-with-traefik-2-0/130357
**Category:** Self-hosting
**Created:** [6 באוקטובר,‏ 2019,‏ 6:57pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357 "2019-10-06T18:57:04Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)
#### Post date: [11 בפברואר,‏ 2020,‏ 8:58am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/21 "2020-02-11T08:58:45Z")

</div>

> [@pc1oad1etter](#):
>
> Something seems to be working, because I in the Traefik dashboard in the services tab, I can see a `discourse@docker` and `discourse_secure@docker`
> 
> However, there is nothing for discourse in the routers tab.

can you share screenshots?

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [11 בפברואר,‏ 2020,‏ 9:03am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/22 "2020-02-11T09:03:14Z")

</div>

Attached are two screenshots from the traefik dashboard. They show that discourse is showing up (twice) in the service, but nothing in the routers. I don’t necessarily know that means TBH but I noticed it.

Edit: I am a new discourse user so I am not trusted to put two images in one post, so I will reply with another.

 ![Screen Shot 2020-02-11 at 10.45.48 AM](https://global.discourse-cdn.com/meta/original/3X/3/4/3407fde3c02fd4cf3178090867c4940cdfd9c6db.png)

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [11 בפברואר,‏ 2020,‏ 9:04am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/23 "2020-02-11T09:04:10Z")

</div>

![Screen Shot 2020-02-11 at 10.46.01 AM](https://global.discourse-cdn.com/meta/original/3X/b/1/b14442524e8e9963961fba8de709d47a4cea096e.png)

---

<div class="post-metadata">

### Author: ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)
#### Post date: [11 בפברואר,‏ 2020,‏ 9:29am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/24 "2020-02-11T09:29:28Z")

</div>

Need to bring up my dockers tonight to compare, let you know than or maybe some others here can share their dashboard and compare

---

<div class="post-metadata">

### Author: ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)
#### Post date: [11 בפברואר,‏ 2020,‏ 2:19pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/25 "2020-02-11T14:19:51Z")

</div>

> [@pc1oad1etter](#):
>
> - “8080:8080” # \<== :8080 is where the dashboard runs on

you don’t need that, better switch to the API and use traefik v2.1, so:  
`- "traefik.http.routers.traefik_dashboard-router.service=api@internal"`  
See [Endless 502 / forwarding when calling dashboard via subdomain #6123 - #5 by ldez - Traefik v2 - Traefik Labs Community Forum](https://community.containo.us/t/endless-502-forwarding-when-calling-dashboard-via-subdomain-6123/3689/5)

can you remove your comments

> [@pc1oad1etter](#):
>
> `# <== Enabli`

> [@pc1oad1etter](#):
>
> `## Log Sett`

it make it easier to read for us.  
No worries I was told the same once :).  
I write my comments in extra line, so I can create a clean print easily using `cat traefikV2.yaml | grep -v "#"`

---

<div class="post-metadata">

### Author: ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)
#### Post date: [11 בפברואר,‏ 2020,‏ 8:09pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/26 "2020-02-11T20:09:24Z")

</div>

here is my dashboard

1. Dashboard  
 ![image](https://global.discourse-cdn.com/meta/original/3X/f/9/f92d8a9174be5c06f4a2b584d06f72eb3c27c3ce.png)
2. HTTP Routers  
 ![image](https://global.discourse-cdn.com/meta/original/3X/e/7/e71492dfd6e914bdc46b5d1aa2423c09c9cafe3a.png)
3. HTTP Services  
 ![image](https://global.discourse-cdn.com/meta/original/3X/2/0/2039189f4032f538d1f708ff0b283400ae1deda8.png)
4. HTTP Middlewares  
 ![image](https://global.discourse-cdn.com/meta/original/3X/2/3/23a2df40b664302a6f696894a9c1b69b4412e826.png)

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [18 בפברואר,‏ 2020,‏ 5:20pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/27 "2020-02-18T17:20:30Z")

</div>

Okay, took me a few days to get to this. I have redone my Traefik configuration to use a yaml file instead of putting it all in docker-compose. However, after wiring everything up again, I seem to get the same or similar behavior – I am getting a 404 at my domain, and in the Traefik dashboard I see entrie under Services and routers for discourse, but nothing under routers.

> **Traefik docker-compose**
>
> ```plaintext
> version: '3'
> 
> services:
> traefik:
> image: traefik:v2.0
> container_name: traefik
> restart: unless-stopped
> security_opt:
> - no-new-privileges:true
> networks:
> - proxy
> ports:
> - 80:80
> - 443:443
> volumes:
> - /etc/localtime:/etc/localtime:ro
> - /var/run/docker.sock:/var/run/docker.sock:ro
> - ./data/traefik.yml:/traefik.yml:ro
> - ./data/acme.json:/acme.json
> labels:
> - "traefik.enable=true"
> - "traefik.http.routers.traefik.entrypoints=http"
> - "traefik.http.routers.traefik.rule=Host(`monitor.example.com`)"
> - "traefik.http.middlewares.traefik-auth.basicauth.users=user:redacted"
> - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
> - "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
> - "traefik.http.routers.traefik-secure.entrypoints=https"
> - "traefik.http.routers.traefik-secure.rule=Host(`monitor.example.com`)"
> - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
> - "traefik.http.routers.traefik-secure.tls=true"
> - "traefik.http.routers.traefik-secure.tls.certresolver=http"
> - "traefik.http.routers.traefik-secure.service=api@internal"
> 
> networks:
> proxy:
> external: true
> 
> ```

> **Traefik data/traefik.yml**
>
> ```plaintext
> api:
> dashboard: true
> 
> entryPoints:
> http:
> address: ":80"
> https:
> address: ":443"
> 
> providers:
> docker:
> endpoint: "unix:///var/run/docker.sock"
> exposedByDefault: false
> 
> certificatesResolvers:
> http:
> acme:
> email: nick@innomadic.com
> storage: acme.json
> httpChallenge:
> entryPoint: http
> 
> ```

> **containers/app.yml**
>
> ```plaintext
> templates:
> - "templates/postgres.template.yml"
> - "templates/redis.template.yml"
> - "templates/web.template.yml"
> - "templates/web.ratelimited.template.yml"
> 
> expose:
> 
> params:
> db_default_text_search_config: "pg_catalog.english"
> 
> db_shared_buffers: "128MB"
> 
> env:
> LANG: en_US.UTF-8
> 
> UNICORN_WORKERS: 2
> 
> DISCOURSE_HOSTNAME: forum.example.com
> 
> DISCOURSE_DEVELOPER_EMAILS: 'info@example.com'
> 
> DISCOURSE_SMTP_ADDRESS: redacted.com
> DISCOURSE_SMTP_PORT: 587
> DISCOURSE_SMTP_USER_NAME: redacted
> DISCOURSE_SMTP_PASSWORD: "redacted"
> 
> LETSENCRYPT_ACCOUNT_EMAIL: info@example.com
> 
> volumes:
> - volume:
> host: /var/discourse/shared/standalone
> guest: /shared
> - volume:
> host: /var/discourse/shared/standalone/log/var-log
> guest: /var/log
> 
> hooks:
> after_code:
> - exec:
> cd: $home/plugins
> cmd:
> - git clone https://github.com/discourse/docker_manager.git
> 
> run:
> - exec: echo "Beginning of custom commands"
> - exec: echo "End of custom commands"
> 
> labels:
> app_name: discourse
> 
> traefik.enable: true
> traefik.docker.network: proxy
> traefik.http.routers.discourse.rule: Host(`forum.example.com`)
> traefik.http.routers.discourse.entrypoints: http
> traefik.http.routers.discourse.middlewares: discourse_redirect2https
> traefik.http.services.discourse.loadbalancer.server.port: 80
> 
> traefik.http.routers.discourse_secure.rule: Host(`forum.example.com`)
> traefik.http.routers.discourse_secure.entrypoints: https
> 
> traefik.http.services.discourse_secure.loadbalancer.server.port: 80
> traefik.http.routers.discourse_secure.tls.certresolver: tlsChallenge_letsencrypt
> 
> traefik.http.middlewares.discourse_redirect2https.redirectscheme.scheme: https
> 
> docker_args:
> - "--network=proxy"
> - "--expose=80"
> 
> ```

I think I ran the `docker network connect proxy` command as well to attach this to the traefik network.

I appreciate any help to see what I’m missing here, and also I would love to hear if I have my security ducks in a row.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [18 בפברואר,‏ 2020,‏ 5:28pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/28 "2020-02-18T17:28:09Z")

</div>

I don’t know what you’re missing. Here’s what I do in Ansible to crank up sites with traefik:

```plaintext
        --docker-args "-l traefik.frontend.rule=Host:{{discourse_hostname}} \
        -l traefik.frontend.entryPoints=https \
        -l traefik.backend={{discourse_shortname}} \
        -l traefik.port=80"

```

And then do

```
       ./launcher start {{ discourse_yml }} {{ docker_args }}

```

Adding the traefik rules in docker\_args rather than in the yml has the added benefit of not having traefik pay attention to the container that’s getting bootstrapped.

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [18 בפברואר,‏ 2020,‏ 5:33pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/29 "2020-02-18T17:33:16Z")

</div>

I think that is Traefik v1 maybe?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [18 בפברואר,‏ 2020,‏ 5:41pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/30 "2020-02-18T17:41:47Z")

</div>

Oh. Sorry. Yeah, I’m pretty sure that’s traefik 1, so I’m not going to be any help with specifics.

It doesn’t look like you’re setting any values in those labels in `app.yml`? I think that you need to set a rule and, maybe a middleware?

If you won’t want down time during a bootstrap you’ll want to set them with `./launcher start` as in my example.

Maybe “middleware” is what used to be “backend”? You’ll need to do something to establish that the Discourse container is the server you want and . . . something else . . . to connect some front end/url with the appropriate backend/server.

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [18 בפברואר,‏ 2020,‏ 6:23pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/31 "2020-02-18T18:23:05Z")

</div>

They are being set, but you have to scroll a bit to the right to see them. Just a formatting thing.

Thanks

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [18 בפברואר,‏ 2020,‏ 6:30pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/32 "2020-02-18T18:30:24Z")

</div>

> [@pc1oad1etter](#):
>
> but you have to scroll a bit to the right to see them.

LOL. Sorry about that.

Well, I have no idea what I’m talking about, but it doesn’t make sense to me that you’d configure your discourse@docker as a load balancer.

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [18 בפברואר,‏ 2020,‏ 7:42pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/33 "2020-02-18T19:42:28Z")

</div>

Hey I think I got it.

I removed the line:  
`# traefik.http.services.discourse_secure.loadbalancer.server.port: 80`

but left this one:

` traefik.http.services.discourse.loadbalancer.server.port: 80`

```plaintext
labels:
  app_name: discourse

  #----Traefik lables------------------------
  traefik.enable: true
  traefik.docker.network: proxy
   #---HTTP ROUTER SECTION-------------------
  traefik.http.routers.discourse.rule: Host(`forum.example.com`)
    #--HTTP SECTION--------------------------
  traefik.http.routers.discourse.entrypoints: http
  traefik.http.routers.discourse.middlewares: discourse_redirect2https
  traefik.http.services.discourse.loadbalancer.server.port: 80

   #---HTTPS ROUTER SECTION
  traefik.http.routers.discourse_secure.rule: Host(`forum.example.com`)
    #--HTTPS SECTION
  traefik.http.routers.discourse_secure.entrypoints: https

 # traefik.http.services.discourse_secure.loadbalancer.server.port: 80
    #--TLS SECTION
  traefik.http.routers.discourse_secure.tls.certresolver: tlsChallenge_letsencrypt

   #---MIDDLEWARE SECTION redirect http to https
  traefik.http.middlewares.discourse_redirect2https.redirectscheme.scheme: https

```

Not sure how I got that or why it is the way it is, but it works. So using all of the configuration I posted above in the thread, but making this one change, is working for me now.

Thanks all!

---

<div class="post-metadata">

### Author: ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)
#### Post date: [20 בפברואר,‏ 2020,‏ 4:43pm UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/34 "2020-02-20T16:43:46Z")

</div>

> [@pc1oad1etter](#):
>
> I removed the line:  
> `# traefik.http.services.discourse_secure.loadbalancer.server.port: 80`
> 
> but left this one:
> 
> ` traefik.http.services.discourse.loadbalancer.server.port: 80`

that is correct.  
I put that in my config:

> #—SERVICE SECTION tell treafik where to send the request  
> traefik.http.services.discourse.loadbalancer.server.port: 80

does that ring a bell?  
What are you doing here is to tell to whom (service) the request is send to and at what port.  
You could solve it also by using `expose` but than for a security perspective you want expose as little as possible of you containers. In addition, traefik picks the first port if yuo expose multiple ports, so using `loadbalancer` is cleaner

* * *

## Traefik data/traefik.yml

> [@pc1oad1etter](#):
>
> endpoint: “unix:///var/run/docker.sock”

I don’t do that as this path is the default path

> [@pc1oad1etter](#):
>
> storage: acme.json

you don’t work with the full path here, using an default path. I don’t like this because you have to keep in mind the path. I do ` storage: /etc/ssl/certs/letsencrypt/acme.json`

I define the network, I don’t like default settings

> ```
> providers:
> docker:
> exposedByDefault: false
> network: bridge_proxy_traefikv2
> 
> ```

## containers/app.yml

> [@pc1oad1etter](#):
>
> ```plaintext
> - "--expose=80"
> 
> ```

you don’t need to do this, this is done by `loadbalancer`

## Traefik docker-compose

> [@pc1oad1etter](#):
>
> networks: proxy: external: true

you may want to give this network a name, in my case

> ```
> networks:
> traefik:
> external:
> name: bridge_proxy_traefikv2
> 
> ```

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [22 בפברואר,‏ 2020,‏ 8:07am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/35 "2020-02-22T08:07:25Z")

</div>

I’ve been working through your suggestions here. Thank you for your response.

I should point out that for the endpoint you say to trust the default and for the storage location you say you don’t like to trust defaults. 🙂

I did try to make the change for acme.json you mentioned:

> [@PackElend](#):
>
> you don’t work with the full path here, using an default path. I don’t like this because you have to keep in mind the path. I do ` storage: /etc/ssl/certs/letsencrypt/acme.json`

However, my traefik container did not find the file then. It showed up as an error in the log. So I have left it as acme.json for now.

I wanted to ask about this one though:

> [@PackElend](#):
>
> you may want to give this network a name, in my case
> 
> > ```plaintext
> > networks:
> > 
> > ```
> 
> traefik:  
> external:  
> name: bridge\_proxy\_traefikv2
> 
> > ```plaintext
> > 
> > ```

Aren’t you just renaming the network here, or giving it a localized name? I think I just referred to it as proxy in the other configuration and here locally. It still has a name that I defined, I am just not renaming it. At least that’s my understanding.

I have one final notable concern. I noticed after my “Success!” post above that although HTTPS is working, I am getting [mixed content](https://support.mozilla.org/1/firefox/73.0.1/Darwin/en-US/mixed-content) warning. So not everything is getting encrypted.

 ![Screen Shot 2020-02-22 at 11.05.19 AM](https://global.discourse-cdn.com/meta/original/3X/d/b/dbeb2715b9a4acb49bd33ed6f86f8b541caf726a.png)

I am getting the mixed content error for my Discourse installation, but not the Wordpress installation I have on the same server. So it must be particular to my Discourse settings.

Looking in the developer console I see:

> Loading mixed (insecure) display content “[http://talk.redacted.com/uploads/default/optimized/1X/\_129430568242d1b7f853bb13ebea28b3f6af4e7\_2\_180x180.png”](http://talk.redacted.com/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_180x180.png%E2%80%9D) on a secure page FaviconLoader.jsm:174:19

So maybe somehow my redirect is not working properly?

I am attaching relevant files below for review.

> **Traefik.yml**
>
> api:  
> dashboard: true
> 
> entryPoints:  
> http:  
> address: “:80”  
> https:  
> address: “:443”
> 
> providers:  
> docker:  
> exposedByDefault: false  
> network: proxy
> 
> certificatesResolvers:  
> http:  
> acme:  
> email: [info@private.com](mailto:info@private.com)  
> storage: acme.json  
> httpChallenge:  
> entryPoint: http

> **Traefik docker-compose**
>
> version: ‘3’
> 
> services:  
> traefik:  
> image: traefik:v2.0  
> container\_name: traefik  
> restart: unless-stopped  
> security\_opt:  
> - no-new-privileges:true  
> networks:  
> - proxy  
> ports:  
> - 80:80  
> - 443:443  
> volumes:  
> - /etc/localtime:/etc/localtime:ro  
> - /var/run/docker.sock:/var/run/docker.sock:ro  
> - ./data/traefik.yml:/traefik.yml:ro  
> - ./data/acme.json:/acme.json  
> labels:  
> - “traefik.enable=true”  
> - “traefik.http.routers.traefik.entrypoints=http”  
> - “traefik.http.routers.traefik.rule=Host(`monitor.private.com`)”  
> - "traefik.http.middlewares.traefik-auth.basicauth.users=private:private”  
> - “traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https”  
> - “traefik.http.routers.traefik.middlewares=traefik-https-redirect”  
> - “traefik.http.routers.traefik-secure.entrypoints=https”  
> - “traefik.http.routers.traefik-secure.rule=Host(`monitor.private.com`)”  
> - “traefik.http.routers.traefik-secure.middlewares=traefik-auth”  
> - “traefik.http.routers.traefik-secure.tls=true”  
> - “traefik.http.routers.traefik-secure.tls.certresolver=http”  
> - “traefik.http.routers.traefik-secure.service=api@internal”
> 
> networks:  
> proxy:  
> external: true

> **app.yml**
>
> templates:
> 
> - “templates/postgres.template.yml”
> - “templates/redis.template.yml”
> - “templates/web.template.yml”
> - “templates/web.ratelimited.template.yml”
> 
> expose:
> 
> params:  
> db\_default\_text\_search\_config: “pg\_catalog.english”
> 
> db\_shared\_buffers: “128MB”
> 
> env:  
> LANG: en\_US.UTF-8
> 
> UNICORN\_WORKERS: 2
> 
> DISCOURSE\_HOSTNAME: [talk.private.com](http://talk.private.com)
> 
> DISCOURSE\_DEVELOPER\_EMAILS: ‘info@private.com’
> 
> LETSENCRYPT\_ACCOUNT\_EMAIL: [info@private.com](mailto:info@private.com)
> 
> volumes:
> 
> - volume:  
> host: /var/discourse/shared/standalone  
> guest: /shared
> - volume:  
> host: /var/discourse/shared/standalone/log/var-log  
> guest: /var/log
> 
> hooks:  
> after\_code:  
> - exec:  
> cd: $home/plugins  
> cmd:  
> - git clone [GitHub - discourse/docker\_manager: Plugin for use with discourse docker image · GitHub](https://github.com/discourse/docker_manager.git)
> 
> run:
> 
> - exec: echo “Beginning of custom commands”
> - exec: echo “End of custom commands”
> 
> labels:  
> app\_name: discourse
> 
> traefik.enable: true  
> traefik.docker.network: proxy  
> traefik.http.routers.discourse.rule: Host(`talk.private.com`)  
> traefik.http.routers.discourse.entrypoints: http  
> traefik.http.routers.discourse.middlewares: discourse\_redirect2https  
> traefik.http.services.discourse.loadbalancer.server.port: 80
> 
> traefik.http.routers.discourse\_secure.rule: Host(`talk.private.com`)  
> traefik.http.routers.discourse\_secure.entrypoints: https  
> traefik.http.routers.discourse\_secure.tls: true  
> traefik.http.routers.discourse\_secure.service: discourse  
> traefik.http.routers.discourse\_secure.tls.certresolver: http
> 
> traefik.http.middlewares.discourse\_redirect2https.redirectscheme.scheme: https
> 
> docker\_args:
> 
> - “–network=proxy”

So, any thoughts about why I’m getting the mixed content error?

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [22 בפברואר,‏ 2020,‏ 8:31am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/36 "2020-02-22T08:31:33Z")

</div>

Well, for a moment I thought discourse had become sentient because I got this notification in my admin view:

 ![Screen Shot 2020-02-22 at 11.18.04 AM](https://global.discourse-cdn.com/meta/original/3X/6/1/610102e60b03c46249bb6a58850d9586b97b3453.png)

However, I made this change and still got the mixed content error. I also logged out, deleted cache and logged in again. Same thing.

It looks like my login requests are still encrypted, so that’s good, I guess, but I need to get ride of this mixed content error. Configuration is above in the previous post.

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [22 בפברואר,‏ 2020,‏ 9:10am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/37 "2020-02-22T09:10:48Z")

</div>

Another update: the mixed content warning is now gone. I’m not clear why. I guess that it’s related to the force\_https setting, however, it I didn’t get a clean page load for maybe 30 minutes after I changed the setting, despite the fact that I cleared my cache and logged out and in, as I noted above.

The good news is I seem to have a functioning Discourse installation behind a Traefic reverse proxy.

---

<div class="post-metadata">

### Author: ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)
#### Post date: [22 בפברואר,‏ 2020,‏ 9:32am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/38 "2020-02-22T09:32:35Z")

</div>

> [@pc1oad1etter](#):
>
> However, I made this change and still got the mixed content error. I also logged out, deleted cache and logged in again. Same thing.

* * *

it is the pics, what are sourced via http connections, had the same problem, see:

- [Cool features of Firefox Developer Tools - #16 by da4nic - Developer Tools - Mozilla Discourse](https://discourse.mozilla.org/t/cool-features-of-firefox-developer-tools/17010/16)
- ["security" tab in developer tools - Developer Tools - Mozilla Discourse](https://discourse.mozilla.org/t/security-tab-in-developer-tools/51827)  
and this should help too:
- [Mixed content problem](https://meta.discourse.org/t/mixed-content-problem/121837)
- [Got mix-content error and confused - #12 by mr8](https://meta.discourse.org/t/got-mix-content-error-and-confused/66523/12)
- [Mixed content due to hotlinked images - #13 by nbianca](https://meta.discourse.org/t/mixed-content-due-to-hotlinked-images/124227/13)

* * *

> [@pc1oad1etter](#):
>
> However, my traefik container did not find the file then. It showed up as an error in the log. So I have left it as acme.json for now.

have you mounted the volume correctly, traefik can be quite confusing when it comes to the paths.  
I do e.g.:

> ```
> volumes:       
> - /etc/ssl/certs/traefik/letsencrypt:/etc/ssl/certs/letsencrypt
> - /opt/traefik/traefik-config.yaml:/etc/traefik/traefik.yaml
> - /etc/passwd.traefik.dashboard:/etc/passwd.BasicAuth.dashboard
> - /etc/passwd.traefik.whoami:/etc/passwd.BasicAuth.whoami
> 
> ```

* * *

> [@pc1oad1etter](#):
>
> Aren’t you just renaming the network here, or giving it a localized name? I think I just referred to it as proxy in the other configuration and here locally. It still has a name that I defined, I am just not renaming it. At least that’s my understanding.

I cannot remember but there was a reason for it, maybe to see it well in the CLI when listing networks

---

<div class="post-metadata">

### Author: ![pc1oad1etter](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pc1oad1etter](https://meta.discourse.org/u/pc1oad1etter)
#### Post date: [22 בפברואר,‏ 2020,‏ 9:41am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/39 "2020-02-22T09:41:20Z")

</div>

> [@PackElend](#):
>
> > [@pc1oad1etter](#):
> >
> > However, my traefik container did not find the file then. It showed up as an error in the log. So I have left it as acme.json for now.
> 
> have you mounted the volume correctly, traefik can be quite confusing when it comes to the paths.  
> I do e.g.:
> 
> > ```plaintext
> > volumes:       
> > 
> > ```
> 
> - /etc/ssl/certs/traefik/letsencrypt:/etc/ssl/certs/letsencrypt
> - /opt/traefik/traefik-config.yaml:/etc/traefik/traefik.yaml
> - /etc/passwd.traefik.dashboard:/etc/passwd.BasicAuth.dashboard
> - /etc/passwd.traefik.whoami:/etc/passwd.BasicAuth.whoami
> 
> > ```plaintext
> > 
> > ```

No I did not mount like this. Here is is my volumes section from docker-compose for traefik:

```plaintext
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data/traefik.yml:/traefik.yml:ro
      - ./data/acme.json:/acme.json

```

I notice that mine doesn’t even mention let’s encypt, whereas yours does. I guess you created that deeply nested folder in your docker-compose directory, and put your acme.json?

the other things I notice is that I have this docker/sock and localtime. Not sure what the localtime one is, and maybe the docker.sock statement is a security problem. Need to read up on that.

---

<div class="post-metadata">

### Author: ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)
#### Post date: [22 בפברואר,‏ 2020,‏ 10:47am UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/40 "2020-02-22T10:47:38Z")

</div>

> [@pc1oad1etter](#):
>
> I notice that mine doesn’t even mention let’s encypt, whereas yours does. I guess you created that deeply nested folder in your docker-compose directory, and put your acme.json?

let’s encrypt cert creation is done by Traefik. Mounting a volume allows me to have it stored on the host instead of the docker  
I recall that getting all the mounting done was a real hassle, did allo of checks doing `docker exec -it`

- `ls`
- `dir`
- `vi`

[Previous page](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357.md?page=1)

[Next page](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357.md?page=3)
