Sign-in redirection broken on non-standard HTTP ports #4203

Closed
opened 2025-11-02 05:42:14 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @flipreverse on GitHub (Oct 28, 2019).

  • Gitea version (or commit ref): 1.9.4
  • Git version: 2.20.1
  • Operating system: Ubuntu 19.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [x ] Not relevant
  • Log gist:

I run Gitea behind an Nginx instance (reverse proxy). My Nginx is available on port 9443. Hence, my Gitea url is https://my.domain:9443/git/.
When I select the sign-in form (/user/login?redirect_to=%2fgit) via the link in the top right corner, enter my credentials, and click sign-in, I get redirected to https://my.domain/git/.
I expect Gitea to redirect me to https://my.domain:9443/git/.
If I, however, directly navigate to the sign-in form (/user/login), it works as expected.

[server]
SSH_DOMAIN       = my.domain
DOMAIN           = my.domain
HTTP_PORT        = 3000
ROOT_URL         = https://my.domain:9443/git/
Originally created by @flipreverse on GitHub (Oct 28, 2019). - Gitea version (or commit ref): 1.9.4 - Git version: 2.20.1 - Operating system: Ubuntu 19.04 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x ] Not relevant - Log gist: I run Gitea behind an Nginx instance (reverse proxy). My Nginx is available on port 9443. Hence, my Gitea url is https://my.domain:9443/git/. When I select the sign-in form (`/user/login?redirect_to=%2fgit`) via the link in the top right corner, enter my credentials, and click sign-in, I get redirected to https://my.domain/git/. I expect Gitea to redirect me to https://my.domain:9443/git/. If I, however, directly navigate to the sign-in form (`/user/login`), it works as expected. ``` [server] SSH_DOMAIN = my.domain DOMAIN = my.domain HTTP_PORT = 3000 ROOT_URL = https://my.domain:9443/git/ ```
Author
Owner

@stale[bot] commented on GitHub (Dec 27, 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 (Dec 27, 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

@zeripath commented on GitHub (Dec 27, 2019):

I believe that this has been fixed already.

@zeripath commented on GitHub (Dec 27, 2019): I believe that this has been fixed already.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4203