Wrong redirect after login - missing trailing slash #5485

Closed
opened 2025-11-02 06:26:08 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @mradeschnig on GitHub (Jun 1, 2020).

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

Description

After Login, I get redirected to the url with missing trailing slash.
I have set the environment ROOTURL=https://domain/gitea/ , after the login I get redirected to
https://domain/gitea , without the trailing slash.
If I add the slash after the login redirect and proceed, I can work without any problems in Gitea.

I run Gitea in docker behind a Apache Reverse Proxy:

<Location "/gitea/" >
ProxyPass http://bigserver:3000/ nocanon
ProxyPassReverse http://bigserver:3000/

Originally created by @mradeschnig on GitHub (Jun 1, 2020). - Gitea version (or commit ref): 1.11.6 - Git version: 2.17.1 - Operating system: Docker on Ubuntu 18.04 - Database (use `[x]`): - [ ] PostgreSQL - [x ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ x] No - [ ] Not relevant - Log gist: ## Description After Login, I get redirected to the url with missing trailing slash. I have set the environment ROOTURL=https://domain/gitea/ , after the login I get redirected to https://domain/gitea , without the trailing slash. If I add the slash after the login redirect and proceed, I can work without any problems in Gitea. I run Gitea in docker behind a Apache Reverse Proxy: <Location "/gitea/" > ProxyPass http://bigserver:3000/ nocanon ProxyPassReverse http://bigserver:3000/ </Location>
Author
Owner

@mradeschnig commented on GitHub (Jun 1, 2020):

I read the documentation and found that there it is mentioned not to have a trailing slash in the reverse proxy entry. It "fixed" my wrong configuration.

<Location "/gitea" >
ProxyPass http://bigserver:3000 nocanon
ProxyPassReverse http://bigserver:3000

@mradeschnig commented on GitHub (Jun 1, 2020): I read the documentation and found that there it is mentioned not to have a trailing slash in the reverse proxy entry. It "fixed" my wrong configuration. <Location "/gitea" > ProxyPass http://bigserver:3000 nocanon ProxyPassReverse http://bigserver:3000
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5485