What's new
PGBlitz.com

Register Now! Find useful tips, Interact /w Community Members and join the part the Best Community on the Internet!

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

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"
 

plex_noob

Senior Member
Staff
Donor
I am not sure oauth is foreseen to work on a different serve than traefik. In fact, both are really integrated.
 

shmookles

Full Member
@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

Senior Member
Staff
Donor
@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!
 
Assists Greatly with Development Costs
Assists Greatly with Development Costs

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads


Development Donations

 

Top NZB NewsGroups!

Members - Up To a 58% Discount!

Trending

Online statistics

Members online
11
Guests online
96
Total visitors
107
Top