Need advice on how to add an entry to traefik for a local home assistant server

Hi People,
I installed a Home assistant vm on my server and i want to have it proxied via traefik with oauth on my plex server vm.
Im not sure what i have to do to get traefik to work.
can anyone assist?

Heya mate, do you know if you’re running Traefik 1 or 2?

I believe Plexguide uses v1.
im semi copying configs to one file atm. what i got is this.

[backends]
	[backends.home-assistant]
		[backends.home-assistant.servers.web1]
			url = "http://192.168.10.160:8123"
			weight = 1
	[backends.blueiris]
		[backends.blueiris.servers.web2]
			url = "http://192.168.20.27:81"
			weight = 1


[frontends]
	[frontends.home-assistant]
		backend = "home-assistant"
		passHostHeader = true
	[frontends.home-assistant.routes.]
		rule = "Host:home-assistant.example.com"
    [frontends.home-assistant.routes]
      [frontends.home-assistant.routes.route-home-assistant-ext]
        rule = "Host:home-assistant.example.com"
    [frontends.home-assistant.headers]
      SSLHost = "example.com"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000
      browserXSSFilter = true
      contentTypeNosniff = true
      customResponseHeaders = "X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex"
      forceSTSHeader = true


	[frontends.blueiris]
		entryPoints = ["http", "https"]
		backend = "blueiris"
		passHostHeader = true
		InsecureSkipVerify = true
    [frontends.blueiris.routes]
      [frontends.blueiris.routes.route-blueiris-ext]
        rule = "Host:blueiris.example.com"
    [frontends.blueiris.headers]
      SSLHost = "example.com"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000
      browserXSSFilter = true
      contentTypeNosniff = true
      customResponseHeaders = "X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex"
      forceSTSHeader = true

not sure if above is correct, and i think i just have to make a rule.toml to get it to find this
now trying to find how to add the oauth

Ah, I had a feeling it was Traefik 1. Not too familiar with 1 as I came straight to v2. I am going to ask someone who might have a better idea, though, as I’m not 100% sure.

I got it working to display the pages with the following config below but its going directly to the page and not to the oauth first.
i need to add this i believe next:
traefik.frontend.auth.forward.address = http://oauth:4181

[backends]
	[backends.home-assistant]
		[backends.home-assistant.servers.web1]
			url = "http://192.168.10.160:8123"
			weight = 1
	[backends.blueiris]
		[backends.blueiris.servers.web2]
			url = "http://192.168.20.27:81"
			weight = 1


[frontends]
	[frontends.home-assistant]
		backend = "home-assistant"
		passHostHeader = true
    [frontends.home-assistant.routes]
      [frontends.home-assistant.routes.route-home-assistant-ext]
        rule = "Host:home-assistant.example.com"
    [frontends.home-assistant.headers]
      SSLHost = "example.com"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000
      browserXSSFilter = true
      contentTypeNosniff = true
      customResponseHeaders = "X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex"
      forceSTSHeader = true

	[frontends.blueiris]
		backend = "blueiris"
		passHostHeader = true
    [frontends.blueiris.routes]
      [frontends.blueiris.routes.route-blueiris-ext]
        rule = "Host:blueiris.example.com"
    [frontends.blueiris.headers]
      SSLHost = "example.com"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000
      browserXSSFilter = true
      contentTypeNosniff = true
      customResponseHeaders = "X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex"
      forceSTSHeader = true

Got it all working!
Thank you for trying to help :slight_smile:

[backends]
	[backends.home-assistant]
		[backends.home-assistant.servers.web1]
			url = "http://192.168.10.160:8123"
			weight = 1
	[backends.blueiris]
		[backends.blueiris.servers.web2]
			url = "http://192.168.20.27:81"
			weight = 1


[frontends]
	[frontends.home-assistant]
		backend = "home-assistant"
		passHostHeader = true
    [frontends.home-assistant.routes]
      [frontends.home-assistant.routes.route-home-assistant-ext]
        rule = "Host:home-assistant.example.com"
    [frontends.home-assistant.headers]
      SSLHost = "example.com"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000
      browserXSSFilter = true
      contentTypeNosniff = true
      customResponseHeaders = "X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex"
      forceSTSHeader = true
	[frontends.home-assistant.auth]
      headerField = "X-WebAuth-User"
	[frontends.home-assistant.auth.forward]
	  address = "http://oauth:4181"
	  trustForwardHeader = true
	  authResponseHeaders = ["X-Forwarded-User"]

	[frontends.blueiris]
		backend = "blueiris"
		passHostHeader = true
    [frontends.blueiris.routes]
      [frontends.blueiris.routes.route-blueiris-ext]
        rule = "Host:blueiris.example.com"
    [frontends.blueiris.headers]
      SSLHost = "example.com"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000
      browserXSSFilter = true
      contentTypeNosniff = true
      customResponseHeaders = "X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex"
      forceSTSHeader = true
	[frontends.blueiris.auth]
      headerField = "X-WebAuth-User"
	[frontends.blueiris.auth.forward]
	  address = "http://oauth:4181"
	  trustForwardHeader = true
	  authResponseHeaders = ["X-Forwarded-User"]
1 Like

Hi,

I’m also currently considering moving my HA to the same VM.

Did you add the config above to the trafeak.toml?

The reason I’m asking is that the supervised installation has quite a few extra docker containers to manage, HA.