Add Other Web Server on Network to Traefik Reverse Proxy w/OAuth | PlexGuide.com

Add Other Web Server on Network to Traefik Reverse Proxy w/OAuth

  • Stop using Chrome! Download the Brave Browser via >>> [Brave.com]
    It's a forked version of Chrome with native ad-blockers and Google's spyware stripped out! Download for Mac, Windows, Android, and Linux!
Welcome to the PlexGuide.com
Serving the Community since 2016!
Register Now

CalDude321

Noobz
Original poster
Jan 26, 2019
1
2
I have another server on my network that I would like to expose externally using the existing Traefik reverse proxy and utilizing the Google OAuth that been setup and in use by the subdomains on the docker containers. I can add the lines below to the bottom of /opt/appdata/traefik/traefik.toml and the server will be exposed via the reverse proxy on the specified subdomain, but wihtout OAuth. Does anyone know what I need to add to have the it go through the existing OAuth? Thanks!

Code:
[file]

[backends]
  [backends.backend1]
    [backends.backend1.servers.server1]
       url = "http://10.0.0.234"

[frontends]
  [frontends.frontend1]
      backend = "backend1"
      passHostHeader = true
      [frontends.frontend1.routes.example]
          rule = "Host:newsub.mydomain.com"
 
  • Like
Reactions: 1 users

plex_noob

Elite
Staff
Donor
Oct 1, 2018
224
113
I am not sure oauth is foreseen to work on a different serve than traefik. In fact, both are really integrated.
 

Admin9705

Administrator
Project Manager
Donor
Jan 17, 2018
5,156
2,112

shmookles

Active
Dec 30, 2018
34
1
@plex_noob and @Admin9705 I figured out how to make OAuth work in addition to Traefik with external servers on the network that are not containers. @plex_noob got me most of the way but you had to add a few extra lines for the Google OAuth portion.

Code:
[file] <--this is needed
[backends]
  [backends.backend1]
    [backends.backend1.servers.server1]
       url = "https://<internal-ip>:<Internal-port>" (This could be http or https depending on service)

[frontends]
  [frontends.frontend1]
      backend = "backend1"
      passHostHeader = true
      [frontends.frontend1.auth.forward]
        address = "http://oauth:4181"
        authResponseHeaders = ["X-Forwarded-User"]
      [frontends.frontend1.routes.example]
          rule = "Host:subdomain.domain.tld"
 
Last edited:

plex_noob

Elite
Staff
Donor
Oct 1, 2018
224
113
@plex_noob and @Admin9705 I figured out how to make OAuth work in addition to Traefik with external servers on the network that are not containers. @plex_noob got me most of the way but you had to add a few extra lines for the Google OAuth portion.

Code:
[file] <--this is needed
[backends]
  [backends.backend1]
    [backends.backend1.servers.server1]
       url = "https://<internal-ip>:<Internal-port>" (This could be http or https depending on service)

[frontends]
  [frontends.frontend1]
      backend = "backend1"
      passHostHeader = true
      [frontends.frontend1.auth.forward]
        address = "http://oauth:4181"
        authResponseHeaders = ["X-Forwarded-User"]
      [frontends.frontend1.routes.example]
          rule = "Host:subdomain.domain.tld"
Yes, you are right. Great suggestion!
 
  • Like
Reactions: 1 user

shmookles

Active
Dec 30, 2018
34
1
@plex_noob do you think this is something we can add eventually into the PGBlitz UI as an option? That way the config doesn't ever get wiped if OAuth or Traefik containers get updated. Thoughts @Admin9705 ?
 

shmookles

Active
Dec 30, 2018
34
1
@Admin9705 and @plex_noob it would seem my solution is now broken, any time I make a change to Traefik.toml, PG says Traefik is not deployed correctly and forces me to re-deploy. This behavior just changed in the last few days. Any idea on how I can make my changes stick without PG complaining?
 

plex_noob

Elite
Staff
Donor
Oct 1, 2018
224
113
Strange. No problem on my side.
 

shmookles

Active
Dec 30, 2018
34
1
@plex_noob I was able to figure it out. There were some new things added to the .toml file when I opened pgblitz menu, so I had to rearrange some of my commends in the right order.
 

Recommend NewsGroups

      Up To a 58% Discount!

Trending