URL Composition Problems with Alternative Port Configurations #1004

Closed
opened 2025-11-02 03:44:57 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @smeddinck on GitHub (Aug 26, 2017).

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

Description

I use an alternative port for gitea via ssl (on nginx). Many API related links (e.g. https://mysite.com/swagger.v1.json or slack integration backlinks) miss the port (since it should be https://mysite.com:4242/swagger.v1.json). Gitea 1.2 on Debian 8 with MySQL

Originally created by @smeddinck on GitHub (Aug 26, 2017). - Gitea version (or commit ref): 1.2 - Git version: - Operating system: Debian 8 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [x] Not relevant - Log gist: ## Description I use an alternative port for gitea via ssl (on nginx). Many API related links (e.g. https://mysite.com/swagger.v1.json or slack integration backlinks) miss the port (since it should be https://mysite.com:4242/swagger.v1.json). Gitea 1.2 on Debian 8 with MySQL
GiteaMirror added the type/bug label 2025-11-02 03:44:57 -06:00
Author
Owner

@0rzech commented on GitHub (Nov 26, 2017):

It's the same for https://mysite.com/mypath/swagger.v1.json. It looks like ROOT_URL is not being prepended to Swagger's basePath. Unfortunately this makes Gitea's Swagger documentation unusable with custom root URLs.

@0rzech commented on GitHub (Nov 26, 2017): It's the same for `https://mysite.com/mypath/swagger.v1.json`. It looks like [`ROOT_URL`](/go-gitea/gitea/blob/v1.2.3/conf/app.ini#L100) is not being prepended to Swagger's [`basePath`](/go-gitea/gitea/blob/v1.2.3/public/swagger.v1.json#L25). Unfortunately this makes Gitea's Swagger documentation unusable with custom root URLs.
Author
Owner

@igsol commented on GitHub (Aug 6, 2018):

I have a similar problem. My Gitea server runs behind SSL reverse proxy which makes not default URL to Gitea service, e.g. https://example.com/gitea/.
But Swagger page continues to use https://example.com/api/v1/ with missed "gitea" part after hostname.

@igsol commented on GitHub (Aug 6, 2018): I have a similar problem. My Gitea server runs behind SSL reverse proxy which makes not default URL to Gitea service, e.g. https://example.com/**gitea**/. But Swagger page continues to use https://example.com/api/v1/ with missed "gitea" part after hostname.
Author
Owner

@0rzech commented on GitHub (Aug 7, 2018):

@igsol This should be fixed in #3572.

@0rzech commented on GitHub (Aug 7, 2018): @igsol This should be fixed in #3572.
Author
Owner

@0rzech commented on GitHub (Aug 8, 2018):

@lunny Mine and @igsol's case is solved, but I am not sure about @smeddinck's, as it seems to be a different kind of bug with different solution.

@0rzech commented on GitHub (Aug 8, 2018): @lunny Mine and @igsol's case is solved, but I am not sure about @smeddinck's, as it seems to be a different kind of bug with different solution.
Author
Owner

@igsol commented on GitHub (Aug 8, 2018):

@0rzech Thanks! I am on v1.4.3 still. Waiting for next release :)

@igsol commented on GitHub (Aug 8, 2018): @0rzech Thanks! I am on v1.4.3 still. Waiting for next release :)
Author
Owner

@0rzech commented on GitHub (Aug 8, 2018):

@igsol You're welcome. ;)

@0rzech commented on GitHub (Aug 8, 2018): @igsol You're welcome. ;)
Author
Owner

@lunny commented on GitHub (Aug 8, 2018):

@smeddinck could you confirm #3572 resolved your issue?

@lunny commented on GitHub (Aug 8, 2018): @smeddinck could you confirm #3572 resolved your issue?
Author
Owner

@0rzech commented on GitHub (Aug 8, 2018):

@igsol I forgot to remind you the fix will be available in 1.6 version, not in 1.5.

@0rzech commented on GitHub (Aug 8, 2018): @igsol I forgot to remind you the fix will be available in 1.6 version, not in 1.5.
Author
Owner

@igsol commented on GitHub (Aug 8, 2018):

@0rzech NP, it's not urgent. The bug actually is not so critical as for me, cause it makes Swagger UI usage a bit harder, but API itself works flawlessly :)

@igsol commented on GitHub (Aug 8, 2018): @0rzech NP, it's not urgent. The bug actually is not so critical as for me, cause it makes Swagger UI usage a bit harder, but API itself works flawlessly :)
Author
Owner

@0rzech commented on GitHub (Aug 8, 2018):

@igsol Sure thing! Just wanted to avoid potential confusion. ;)

@0rzech commented on GitHub (Aug 8, 2018): @igsol Sure thing! Just wanted to avoid potential confusion. ;)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1004