Customizing Gitea: Bad Gateway #4167

Closed
opened 2025-11-02 05:40:57 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @derSense on GitHub (Oct 23, 2019).

Good Morning,

i have the following issue:

I want to Customize some my Gitea Installation, for example i want to remove the "Help" Button in the Top Navigation.

For this i downloaded the "head_navbar.tmpl" from git.
Made my changes.
Copy it into /var/lib/gitea/custom/templates/base via FTP
sudo systemctl restart gitea

and the Application is not running anymore: Bad Gateway
i cannot see any Error in the Gitea Log

My Setting ist CentOS4 / MariaDB / NGINX as Reverseproxy -> all traffic is going through http for the moment.

Is there somebody who also had this issue and can help?

Originally created by @derSense on GitHub (Oct 23, 2019). Good Morning, i have the following issue: I want to Customize some my Gitea Installation, for example i want to remove the "Help" Button in the Top Navigation. For this i downloaded the "head_navbar.tmpl" from git. Made my changes. Copy it into /var/lib/gitea/custom/templates/base via FTP sudo systemctl restart gitea and the Application is not running anymore: Bad Gateway i cannot see any Error in the Gitea Log My Setting ist CentOS4 / MariaDB / NGINX as Reverseproxy -> all traffic is going through http for the moment. Is there somebody who also had this issue and can help?
GiteaMirror added the type/question label 2025-11-02 05:40:57 -06:00
Author
Owner

@zeripath commented on GitHub (Oct 23, 2019):

Bad gateway implies that Gitea is not running.

So there must be a problem with compiling the custom template. (Likely at the macaron level hence the poor logging.)

I think without seeing your template I think we're at a bit of a loss as to how to help except to say are you sure that your template is correct?

PS the the issue template is there for a reason. You haven't told us what version you're using so I can't even look up Which version of the template you should be looking at. I can't advise you on how to try to get extra logging either.

@zeripath commented on GitHub (Oct 23, 2019): Bad gateway implies that Gitea is not running. So there must be a problem with compiling the custom template. (Likely at the macaron level hence the poor logging.) I think without seeing your template I think we're at a bit of a loss as to how to help except to say are you sure that your template is correct? PS the the issue template is there for a reason. You haven't told us what version you're using so I can't even look up Which version of the template you should be looking at. I can't advise you on how to try to get extra logging either.
Author
Owner

@derSense commented on GitHub (Oct 23, 2019):

Thank you for the quick reply,

i am using Gitea 1.9.4
i got my template from here: https://github.com/go-gitea/gitea/tree/master/templates/base / master branch -> mybe here is the problem?

i got the error also if i copy an unmodified /orig version of the "head_navbar.tmpl"

@derSense commented on GitHub (Oct 23, 2019): Thank you for the quick reply, i am using Gitea 1.9.4 i got my template from here: https://github.com/go-gitea/gitea/tree/master/templates/base / master branch -> mybe here is the problem? i got the error also if i copy an unmodified /orig version of the "head_navbar.tmpl"
Author
Owner

@zeripath commented on GitHub (Oct 23, 2019):

Yeah that would explain it. Use the 1.9 release branch or 1.9.4 version.

@zeripath commented on GitHub (Oct 23, 2019): Yeah that would explain it. Use the 1.9 release branch or 1.9.4 version.
Author
Owner

@derSense commented on GitHub (Oct 23, 2019):

i tested it with the head_navbar.tmpl of 1.9.4 version and also with the 1.9 feature branch, but also the same result,

maybe something with nginx ??
this is my reverse proxy setting:

server {
listen 80;
server_name git.example.com;

location / {
    proxy_pass http://localhost:3000;
}

}

@derSense commented on GitHub (Oct 23, 2019): i tested it with the head_navbar.tmpl of 1.9.4 version and also with the 1.9 feature branch, but also the same result, maybe something with nginx ?? this is my reverse proxy setting: server { listen 80; server_name git.example.com; location / { proxy_pass http://localhost:3000; } }
Author
Owner

@zeripath commented on GitHub (Oct 23, 2019):

Are you sure Gitea is running?

@zeripath commented on GitHub (Oct 23, 2019): Are you sure Gitea is running?
Author
Owner

@derSense commented on GitHub (Oct 23, 2019):

yes it is i am already working with it.

but as soon as i put a tmpl file into the custom folder and restart the gitea service it crashes.
then i delete the uploaded file und restart the service again, all is up and running

this is my setting from gitea settings:
Repository-Wurzelpfad: /home/git/gitea-repositories
Verzeichnis für statische Dateien: /var/lib/gitea
Benutzerdefinierter Root Pfad: /var/lib/gitea/custom
Logdateipfad: /var/lib/gitea/log
Skript-Typ: bash
Nutzer bei Reverse-Authentifizierung: X-WEBAUTH-USER
GITEA_WORK_DIR /var/lib/gitea

it says my workdir is: /var/lib/gitea/custom
so i created there a folder templates and a folder base inside of it

and the i put the head_navbar.tmpl (v1.9.4) in:
/var/lib/gitea/custom/template/base
which should be the right structure if i understand the documentation right

@derSense commented on GitHub (Oct 23, 2019): yes it is i am already working with it. but as soon as i put a tmpl file into the custom folder and restart the gitea service it crashes. then i delete the uploaded file und restart the service again, all is up and running this is my setting from gitea settings: Repository-Wurzelpfad: /home/git/gitea-repositories Verzeichnis für statische Dateien: /var/lib/gitea Benutzerdefinierter Root Pfad: /var/lib/gitea/custom Logdateipfad: /var/lib/gitea/log Skript-Typ: bash Nutzer bei Reverse-Authentifizierung: X-WEBAUTH-USER GITEA_WORK_DIR /var/lib/gitea it says my workdir is: /var/lib/gitea/custom so i created there a folder templates and a folder base inside of it and the i put the head_navbar.tmpl (v1.9.4) in: /var/lib/gitea/custom/template/base which should be the right structure if i understand the documentation right
Author
Owner

@derSense commented on GitHub (Oct 23, 2019):

i have got it working, didn't know why but a complete reboot auf CENTOS helped !?

@derSense commented on GitHub (Oct 23, 2019): i have got it working, didn't know why but a complete reboot auf CENTOS helped !?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4167