Two factor login redirects to favicon #3470

Closed
opened 2025-11-02 05:13:49 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @sardaukar on GitHub (Jun 14, 2019).

  • Gitea version (or commit ref): 1.9.0+dev-257-g7dd983797
  • Git version: 2.22.0
  • Operating system: Manjaro Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

When I login to my self-hosted instance of Gitea using 2FA, I always get redirected to a 404 at base_url/favicon.ico . Am I doing something wrong? I'm using the gitea/gitea docker image from Docker Hub. I can just change the URL to base_url and it works, but I was wondering if there's anything I can do to fix it. My nginx config:

server {
  server_name MY_SERVER_NAME;

  listen 443 ssl;
  add_header Strict-Transport-Security "max-age=31536000";

  ssl on;
  ssl_certificate     /etc/letsencrypt/live/MY_SERVER_NAME/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/MY_SERVER_NAME/privkey.pem;

  ssl_protocols  SSLv3 TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers RC4:HIGH:!aNULL:!MD5;
  ssl_prefer_server_ciphers on;
  keepalive_timeout    60;
  ssl_session_cache    shared:SSL:10m;
  ssl_session_timeout  10m;

  location / {
    proxy_pass http://localhost:10080;

    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
    proxy_set_header        Accept-Encoding   "";
    proxy_set_header        Host            $host;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header        X-Forwarded-Proto $scheme;
    add_header              Front-End-Https   on;
    proxy_redirect     off;
  }
}
Originally created by @sardaukar on GitHub (Jun 14, 2019). - Gitea version (or commit ref): 1.9.0+dev-257-g7dd983797 - Git version: 2.22.0 - Operating system: Manjaro Linux - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description When I login to my self-hosted instance of Gitea using 2FA, I always get redirected to a 404 at `base_url`/favicon.ico . Am I doing something wrong? I'm using the `gitea/gitea` docker image from Docker Hub. I can just change the URL to `base_url` and it works, but I was wondering if there's anything I can do to fix it. My nginx config: ``` server { server_name MY_SERVER_NAME; listen 443 ssl; add_header Strict-Transport-Security "max-age=31536000"; ssl on; ssl_certificate /etc/letsencrypt/live/MY_SERVER_NAME/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/MY_SERVER_NAME/privkey.pem; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; keepalive_timeout 60; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; location / { proxy_pass http://localhost:10080; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_set_header Accept-Encoding ""; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; add_header Front-End-Https on; proxy_redirect off; } } ```
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 05:13:49 -06:00
Author
Owner

@stale[bot] commented on GitHub (Aug 13, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Aug 13, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Aug 27, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Aug 27, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@jameyg commented on GitHub (Nov 20, 2019):

We are also experiencing this same issue. Everyone has 2FA and is redirected to the favicon as described above.

@jameyg commented on GitHub (Nov 20, 2019): We are also experiencing this same issue. Everyone has 2FA and is redirected to the favicon as described above.
Author
Owner

@lunny commented on GitHub (Nov 20, 2019):

I think this is because static file request path has been saved to session.

@lunny commented on GitHub (Nov 20, 2019): I think this is because static file request path has been saved to session.
Author
Owner

@nuno-silva commented on GitHub (Dec 1, 2020):

@sardaukar please check if what you're experiencing is https://github.com/go-gitea/gitea/issues/13771

@nuno-silva commented on GitHub (Dec 1, 2020): @sardaukar please check if what you're experiencing is https://github.com/go-gitea/gitea/issues/13771
Author
Owner

@sardaukar commented on GitHub (Dec 1, 2020):

This is no longer happening to me with newer versions of Gitea.

@sardaukar commented on GitHub (Dec 1, 2020): This is no longer happening to me with newer versions of Gitea.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3470