Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homarr don't work over reverse proxy #2171

Closed
4 tasks done
Mike710Shine opened this issue Oct 26, 2024 · 11 comments · Fixed by #2177
Closed
4 tasks done

Homarr don't work over reverse proxy #2171

Mike710Shine opened this issue Oct 26, 2024 · 11 comments · Fixed by #2177
Assignees
Labels
🐛 Bug Something isn't working

Comments

@Mike710Shine
Copy link

Environment

Docker

Version

0.15.6

Describe the problem

I hosting homarr with an docker container and have an Nginx Proxy Manager config with an local dns setup. When i try to login over the revese proxy it won't login an these maschines who are was logged in in the past can't log out.
Over the IP adress i don't have any Problem only over the reverse proxy one.
When i login over the IP i see in the log that i would like to login but not over the reverse proxy site.

Logs

Exporting hostname...
Migrating database...
yarn run v1.22.19
$ tsx ./migrate.ts
Done in 1.40s.
Starting production server...
Listening on port 7575 url: http://9487864b4e84:7575
ℹ Local icons repository directory exists and contains 6 icons
ℹ Saving updated configuration of 'MikeStandard' config.
Exporting hostname...
Migrating database...
yarn run v1.22.19
$ tsx ./migrate.ts
Done in 0.30s.
Starting production server...
Listening on port 7575 url: http://9487864b4e84:7575
Exporting hostname...
Migrating database...
yarn run v1.22.19
$ tsx ./migrate.ts
Done in 0.29s.
Starting production server...
Listening on port 7575 url: http://9487864b4e84:7575
Exporting hostname...
Migrating database...
yarn run v1.22.19
$ tsx ./migrate.ts
Done in 0.22s.
Starting production server...
Listening on port 7575 url: http://9487864b4e84:7575
user mike710shine is trying to log in. checking password...
user mike710shine successfully authorized
ℹ Saving updated configuration of 'MikeStandard' config.
user mike710shine is trying to log in. checking password...
user mike710shine successfully authorized
user mike710shine is trying to log in. checking password...
user mike710shine successfully authorized

Context

grafik

Please tick the boxes

  • I confirm that I attached the proper logs
  • I've read the docs
  • I've checked for duplicate issues
  • I've tried to debug myself
@Mike710Shine Mike710Shine added the 🐛 Bug Something isn't working label Oct 26, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Homarr Kanban Oct 26, 2024
Copy link

Hi 👋. Thank you for submitting your first issue to Homarr. Please ensure that you've provided all nessesary information. You can use the three dots > Edit button to update your post with additional images and information. Depending on the current volume of requests, the team should get in conact with you shortly.

@Meierschlumpf
Copy link
Collaborator

@Meierschlumpf Meierschlumpf self-assigned this Oct 27, 2024
@bessdsv
Copy link

bessdsv commented Oct 27, 2024

same problem with traefik reverse proxy.

compose file:

homarr:
    container_name: homarr
    image: ghcr.io/ajnart/homarr:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/conts/homarr/data:/data
      - /opt/conts/homarr/icons:/app/public/icons
      - /opt/conts/homarr/config:/app/data/configs
      - /mnt:/mnt
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.homarr-http.rule=HostRegexp(`(?i)homarr\\.besshome\\.?`)"
      - "traefik.http.routers.homarr-http.entrypoints=http"
      - "traefik.http.routers.homarr-http.service=homarr-http"
      - "traefik.http.services.homarr-http.loadbalancer.server.port=7575"
traefik:
    image: traefik:latest
    container_name: traefik
    restart: always
    privileged: true
    security_opt:
      - no-new-privileges:true
    ports:
      - "80:80"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /opt/conts/traefik/config:/etc/traefik
      - /mnt:/mnt

traefik.yml:

api:
  dashboard: true
  insecure: true

serversTransport:
  insecureSkipVerify: true

entryPoints:
  http:
    address: ":80"

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false

when i run my server and go to page http://homarr.bessdsv i see login page.
But when i try to login it not happens.

@Meierschlumpf
Copy link
Collaborator

Hey guys, can you try out the credentials-login-stuck image and give me the logs. Also can you check if setting NEXTAUTH_URL to http://localhost:7575 would resolve your issue?

@ektorasdj
Copy link

ektorasdj commented Oct 27, 2024

Hello (unbound dns->nginx synology->local domain),

Compose:

version: "3.9"
services:
  homarr:
    container_name: Homarr
    image: ghcr.io/ajnart/homarr:credentials-login-stuck
    mem_limit: 4g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    restart: on-failure:5
    ports:
      - 4755:7575
    volumes:
      - /volume2/docker/homarr:/app/data/configs:rw
      - /volume2/docker/homarr/data:/data:rw
      - /volume2/docker/homarr/icons:/app/public/icons:rw
      - /volume2/docker/homarr/imgs:/app/public/imgs:rw
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
     TZ: Europe/Athens
     #BASE_URL: http://home.local
     #NODE_TLS_REJECT_UNAUTHORIZED: 0
     NEXTAUTH_URL: http://localhost:7575

Logs (it keeps going like this):

2024-10-27T15:56:46.213878564Z Exporting hostname...
2024-10-27T15:56:46.214912749Z Migrating database...
2024-10-27T15:56:46.484743237Z yarn run v1.22.19
2024-10-27T15:56:46.524873399Z $ tsx ./migrate.ts
2024-10-27T15:56:47.019320391Z Done in 0.54s.
2024-10-27T15:56:47.038702336Z Starting production server...
2024-10-27T15:56:48.976602237Z Listening on port 7575 url: http://2335360cc5bd:7575
2024-10-27T15:56:58.719727787Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:56:58.727685207Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:56:59.377236316Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:56:59.378664176Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:56:59.385775302Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:56:59.610907298Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:05.105130944Z ℹ Authentication endpoint called method=GET url=/api/auth/providers
2024-10-27T15:57:05.139593911Z ℹ Authentication endpoint called method=GET url=/api/auth/csrf
2024-10-27T15:57:05.178818405Z ℹ Authentication endpoint called method=POST url=/api/auth/callback/credentials
2024-10-27T15:57:05.179973640Z ℹ Redirecting to http://home.local/
2024-10-27T15:57:05.215717898Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:05.267871653Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:05.458709730Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:09.695487054Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:09.740584711Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:09.741885457Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:57:09.748722001Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:57:19.869490874Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:19.911538838Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:19.912119839Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:57:19.917606089Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:57:30.048046510Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:30.098522250Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:30.099440441Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:57:30.105577958Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:57:40.260662882Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:40.304821657Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:40.305629573Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:57:40.311318635Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:57:50.442572594Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:50.487017601Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:57:50.487722095Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:57:50.493208298Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:58:00.624402507Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:58:00.671811238Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:58:00.672802577Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:58:00.678169330Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:58:10.814202243Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:58:10.857976928Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:58:10.858662350Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:58:10.864273345Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:58:20.997188961Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:58:21.040014736Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:58:21.040762894Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:58:21.045635350Z ℹ Redirecting to http://localhost:7575/
2024-10-27T15:58:31.186269038Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:58:31.230342961Z ℹ Authentication endpoint called method=GET url=/api/auth/session
2024-10-27T15:58:31.230869456Z ℹ Redirecting to http://2335360cc5bd:7575/
2024-10-27T15:58:31.236439730Z ℹ Redirecting to http://localhost:7575/

@Meierschlumpf Meierschlumpf pinned this issue Oct 31, 2024
@Meierschlumpf
Copy link
Collaborator

@bessdsv, thanks for your configuration. I was able to reproduce the issue with it and will now start investigating why it's not working 👍🏼

@Meierschlumpf
Copy link
Collaborator

I probably found the cause and am finding a way to fix it right now

@Meierschlumpf
Copy link
Collaborator

In about 10 minutes you should be able to try out the image tag fix-credentials-login-behind-proxy, so ghcr.io/ajnart/homarr:fix-credentials-login-behind-proxy. Give me feedback if it worked and also if not! Thanks ❤️

@lvitie
Copy link

lvitie commented Oct 31, 2024

fix-credentials-login-behind-proxy works for me

@ektorasdj
Copy link

Works Great! Thank you !

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Homarr Kanban Nov 1, 2024
@Meierschlumpf
Copy link
Collaborator

Fixed in 0.15.7

@manuel-rw manuel-rw unpinned this issue Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants