ChaOConnor

[REQUEST] Traefik reverse proxy

53 posts in this topic Last Reply

Recommended Posts

I guess I don't have any good reason other than I hold the LinuxServer.io team's work in high regard and they're base is very stable.  I use all their apps almost exclusively.

 

I should try Treafik's, good point.  Thanks.

Share this post


Link to post

I realized I have no idea how to install a docker that doesn't have a template.  Should I create a template for it? (How do I do that?)  Thanks!

Share this post


Link to post
37 minutes ago, ChaOConnor said:

I realized I have no idea how to install a docker that doesn't have a template.  Should I create a template for it? (How do I do that?)  Thanks!

Enable docker hub searching in community applications, then search for and install it using the apps tab as normal. You may have to adjust some settings, but with an app this simple it'll probably work with little to no tweaking.

  • Upvote 1

Share this post


Link to post
17 hours ago, ChaOConnor said:

I guess I don't have any good reason other than I hold the LinuxServer.io team's work in high regard and they're base is very stable.  I use all their apps almost exclusively.

 

I should try Treafik's, good point.  Thanks.

I am trying to set this up too, but I am having a little difficulty also...

Not sure what I need to do to get the letsencrypt going or what to set for the front/backends...

If you have any success please post...

Edited by airbillion

Share this post


Link to post

Very interesting...this may replace Nginx for me.

 

Edit: I just tried to set it up and I can't really seem to get it to work either. It starts, but I can't connect to it.

Edited by brando56894

Share this post


Link to post
Very interesting...this may replace Nginx for me.
 
Edit: I just tried to set it up and I can't really seem to get it to work either. It starts, but I can't connect to it.
That is the same issue I had...I couldn't connect to it either...

Sent from my ONEPLUS A3000 using Tapatalk

Share this post


Link to post

Looking at the config file (I also tried to set it up in Arch, but couldn't connect to the management UI, but it was serving on port 80) it looks like additional configuration needs to be done so it's not as easy as some of the other containers. Bummer.

Share this post


Link to post

I managed to get the management GUI to work. I can't figure out how to get it to connect to the Docker daemon so that it will list and watch the containers.

 

I had to drop the default config file in /mnt/user/appdata/traefik/traefik.toml and enable a few things.

 

I added a port mapping for 8080:8080 and a folder mapping for /mnt/usr/share/appdata/traefik:/etc/traefik/

 

Here's the default one that's about 1000 lines: https://raw.githubusercontent.com/containous/traefik/master/traefik.sample.toml

 

/etc/traefik/traefik.toml


debug = false
traefikLogsFile = "/etc/traefik/traefik.log"
logLevel = "INFO"

[web]
address = ":8080"

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "docker.localhost"
watch = true
exposedbydefault = true

Edited by brando56894

Share this post


Link to post

Most info I found for this is in French. Does this allow you to setup reverse proxies for all Dockers like nzbget, plex, couch, etc? Can you do all the proxy configuration in a GUI?

 

That would be nice.

 

 

Share this post


Link to post
On 8/22/2017 at 4:26 PM, hernandito said:

Does this allow you to setup reverse proxies for all Dockers like nzbget, plex, couch, etc?

 

Yep, apparently it will dynamically create reverse proxies for you or you can set them up yourself.

 

On 8/22/2017 at 4:26 PM, hernandito said:

Can you do all the proxy configuration in a GUI?

 

It appears that way, but I can't get Traefik to connect to the Docker socket, so it doesn't show anything.

 

Edit: I forgot to map /var/run/docker.sock inside the container, so that's why it won't connect! D'oh! I'll give it another try when I get home and it should work as expected.

 

Edit 2: yep just map /var/run/docker.sock to the same inside the container and it works as expected.

Edited by brando56894

Share this post


Link to post
On 8/23/2017 at 0:33 AM, brando56894 said:

 

Yep, apparently it will dynamically create reverse proxies for you or you can set them up yourself.

 

 

It appears that way, but I can't get Traefik to connect to the Docker socket, so it doesn't show anything.

 

Edit: I forgot to map /var/run/docker.sock inside the container, so that's why it won't connect! D'oh! I'll give it another try when I get home and it should work as expected.

 

Edit 2: yep just map /var/run/docker.sock to the same inside the container and it works as expected.

 

Is this working well for you?

 

Are all the reverse proxies working correctly.....and have you tried it with letsencrypt yet?

 

This looks like a good all in one solution, but I just want to know how it compares to the nginx letsencrypt...

 

Thanks!

Share this post


Link to post

It was too confusing for me, I couldn't get any of the proxies to work for me so I just stuck with my Arch VM that has Nginx running.

Share this post


Link to post
Posted (edited)

after spending another few hours I managed to get it to run - however when using "exposedbydefault = false" and in the responding docker containers the variables:

  • traefik.frontend.rule
  • traefik.backend
  • traefik.enable
  • traefik.port

no container can be viewed. any hints? I think the issue that I'm supposed to set the traefik container as well as the other responding docker containers on to the same network - could this be the issue? anyways when using "bridge" mode I would assume they are already on the same network so there shouldn't be the need for it.

 

there is a blog post available by Linuxserver.io at: https://www.linuxserver.io/2018/02/03/using-traefik-as-a-reverse-proxy-with-docker/ following that my certificates are generated. however using the exposedbydefault flag I still can't manage to view the assigned docker apps. and with it set to true I receive 404 on all pages.

 

anyone figured it out how to set it correctly?

Edited by twok
progress2

Share this post


Link to post
Quote

anyone figured it out how to set it correctly?

Same question

Share this post


Link to post
On 4/6/2018 at 4:09 AM, ufo56 said:

Same question

 

Same Question as well.

Share this post


Link to post

I decided to mess around with this tonight a bit, and was able to get basic proxying working fine after skimming their docs.

Didn't try the letsencrypt yet as I would have to mess with my current running nginx server and ports.

Hope this helps those that had issues:

 

 

For reference, here is the toml config i threw together.

on my test dockers I added this to the extra parameters field: -l=traefik.enable=true

 

### Globals ###
debug = false
logLevel = "INFO"

### Entrypoints ###
defaultEntryPoints = ["http", "https"]

[entryPoints]
  [entryPoints.http]
    address = ":80"
    [entryPoints.http.redirect]
      entryPoint = "https"
  [entryPoints.https]
    address = ":443"
    [entryPoints.https.tls]
	
  [entryPoints.webui]
    address=":8080"
    [entryPoints.webui.auth]
      [entryPoints.webui.auth.basic]
         users = ["admin:$apr1$0DIFsecrethashU6aJdI2XG1"]

### Logging ###
[traefikLog]
filepath = "/etc/traefik/traefik.log"
	
### Web Dashboard ###
[api]
entrypoint = "webui"
	
### Backends ###
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "my.domain.com"
watch = true
exposedbydefault = false

Docker settings were simple with just the ports and required paths:

 

Ports:
443
80
8080

Paths:
/var/run/docker.sock:/var/run/docker.sock
/etc/traefik/:/mnt/cache/.Programs/traefik/

 

Share this post


Link to post
Posted (edited)

@ninthwalker

Could you also explain what you did about the Traefik Labels on the Dockers you got Proxy to work? Are the labels just added as extra parameters? Also, what about the Network parameter.....can we just use "bridge" for both Traefik and other containers? Or do we need to actually create a new network?

 

--label traefik.enable=true --label traefik.port=8080 --label traefik.docker.network=bridge --label traefik.frontend.rule=Host:traefik.example.com

 

traefik looks like next-gen nginx........I Just wish there was a more user-friendly setup for it :(

Edited by Stupifier

Share this post


Link to post
On 4/15/2018 at 9:02 PM, Stupifier said:

@ninthwalker

traefik looks like next-gen nginx........I Just wish there was a more user-friendly setup for it :(

 

I wish the same...

 

Would this docker also handle the duties of serving web pages as well? PHP, html, JS.

 

 

Share this post


Link to post
Posted (edited)

@Stupifier

i left the dockers I tested with in the bridge network. 

 

Only thing i added to existng dockers for them to be picked up by traefik was add the one label to extra parameters. 

 

-l=‘traefik.enable=true’

 

@hernandito

traefik is a proxy only. Not a webserver. 

For that you still need nginx/Apache or check out caddy. 

Edited by ninthwalker

Share this post


Link to post
[mention=79664]Stupifier[/mention]
i left the dockers I tested with in the bridge network. 
 
Only thing i added to existng dockers for them to be picked up by traefik was add the one label to extra parameters. 
 
-l=‘traefik.enable=true’
 
[mention=6274]hernandito[/mention]
traefik is a proxy only. Not a webserver. 
For that you still need nginx/Apache or check out caddy. 
If you get this all figured out including the LetsEncrypt certs, hopefully we'll see an UnRAID Template for all us noobs :)

Share this post


Link to post

Not sure if i’ll be doing anything more to be honest. My nginx setup is on a seperate  Server and runs pretty good/automated already for everything. 

 

Fooled around with Traefik, and while the auto-proxy for each docker is cool, I don’t know if it would benefit me much.

 

good luck!

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Copyright © 2005-2018 Lime Technology, Inc.
unRAID® is a registered trademark of Lime Technology, Inc.