Reviewed-on URL in commit message footer does not use ROOT_URL #13992

Closed
opened 2025-11-02 10:59:28 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @PaulBol on GitHub (Jan 15, 2025).

Description

After installing Gitea 1.23.1 I find that the footer for a pull request commit is populated with a Reviewed-on URL that does not reflect the configured public URL.

Previously, the generated message looked like this where gitea.mycompany.com is the configured ROOT_URL value:

Reviewed-on: https://gitea.mycompany.com/Company/Project/pulls/1234
Reviewed-by: My Colleague <mycolleague@mycompany.com>

Now I see

Reviewed-on: https://127.0.0.1:3000/Company/Project/pulls/1234
Reviewed-by: My Colleague <mycolleague@mycompany.com>

127.0.0.1 is HTTP_ADDR. However, users access the installation at https://gitea.mycompany.com/.

Gitea Version

1.23.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

grafik

Git Version

No response

Operating System

Ubuntu 20.04

How are you running Gitea?

Running downloaded package behind nginx as SSL endpoint

Database

MySQL/MariaDB

Originally created by @PaulBol on GitHub (Jan 15, 2025). ### Description After installing Gitea 1.23.1 I find that the footer for a pull request commit is populated with a Reviewed-on URL that does not reflect the configured public URL. Previously, the generated message looked like this where gitea.mycompany.com is the configured `ROOT_URL` value: ```text Reviewed-on: https://gitea.mycompany.com/Company/Project/pulls/1234 Reviewed-by: My Colleague <mycolleague@mycompany.com> ``` Now I see ```text Reviewed-on: https://127.0.0.1:3000/Company/Project/pulls/1234 Reviewed-by: My Colleague <mycolleague@mycompany.com> ``` 127.0.0.1 is `HTTP_ADDR`. However, users access the installation at https://gitea.mycompany.com/. ### Gitea Version 1.23.1 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![grafik](https://github.com/user-attachments/assets/2f5118cc-2b07-4c7e-8885-433588959d85) ### Git Version _No response_ ### Operating System Ubuntu 20.04 ### How are you running Gitea? Running downloaded package behind nginx as SSL endpoint ### Database MySQL/MariaDB
GiteaMirror added the issue/needs-feedback label 2025-11-02 10:59:28 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jan 15, 2025):

I think you are using reverse-proxy. You need to correctly setup the reverse-proxy with some headers: https://docs.gitea.com/next/administration/reverse-proxies

@wxiaoguang commented on GitHub (Jan 15, 2025): I think you are using reverse-proxy. You need to correctly setup the reverse-proxy with some headers: https://docs.gitea.com/next/administration/reverse-proxies
Author
Owner

@PaulBol commented on GitHub (Jan 15, 2025):

Thanks for the quick response @wxiaoguang.

Turns out I had

proxy_set_header X-Forwarded-Host $host;

in the nginx config file which worked up to Gitea 1.22.

Changing the line to

proxy_set_header Host $host;

resolved the problem for 1.23.1.

Thanks again! I'm closing this issue.

@PaulBol commented on GitHub (Jan 15, 2025): Thanks for the quick response @wxiaoguang. Turns out I had ``` proxy_set_header X-Forwarded-Host $host; ``` in the nginx config file which worked up to Gitea 1.22. Changing the line to ``` proxy_set_header Host $host; ``` resolved the problem for 1.23.1. Thanks again! I'm closing this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13992