mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-14 20:07:40 -05:00
UI Breaks with Nginx proxy_pass #1821
Closed
opened 2025-11-02 04:14:18 -06:00 by GiteaMirror
·
12 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16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0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
type/question
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#1821
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @methodbox on GitHub (May 25, 2018).
[x]):Description
Using a basic proxy_pass in Nginx breaks asset paths instantly. Fresh install with proxy_pass URL specified doesn't work.
Updating app.ini doesn't work
Proxy pass settings:
App works without Nginx on 3000, but that's kind of useless. I'm afraid it will break using a valid domain name.
Screenshots
@niclashoyer commented on GitHub (May 25, 2018):
This is the location block that I use:
don't know if the
try_filesis actually necessary?@jonasfranz commented on GitHub (May 25, 2018):
Please checkout our guide for using reverse proxies: https://docs.gitea.io/en-us/reverse-proxies/#using-nginx-as-a-reverse-proxy
Do the problems occur still after following our guide?
@lunny commented on GitHub (May 25, 2018):
@niclashoyer maybe you can also contribute to https://docs.gitea.io/en-us/reverse-proxies/#using-nginx-as-a-reverse-proxy when using unixsock protocols.
@methodbox commented on GitHub (May 25, 2018):
My config is very much the same but I did not specify the server name and you might be right about the try methods; they’re in their by default and I’ve only ever had to add to them.
I’ll give this a try later.
Did not realize you had a special guide but to be honest I’ve never had to use special configuration for proxying a given web app from its port to port 80.
I build Nodejs apps and haven’t experienced this problem, but not familiar with Go enough to understand if it’s somehow different.
@jonasfranz commented on GitHub (May 25, 2018):
@methodbox You could also set the port of gitea to 80 or 433 (if you prefer https) but this may require root.
@techknowlogick commented on GitHub (May 25, 2018):
Here is a sample configuration that @thehowl posted to our Forum: https://discourse.gitea.io/t/call-gitea-as-a-subdomain-of-nginx/266/2
@methodbox commented on GitHub (May 26, 2018):
@JonasFranzDEV That’s a terrible recommendation from a security standpoint.
Your application should never also be it’s own web server, let alone be allowed to handle HTTPS transactions.
This coupled with the idea that you suggested root being the owner of the process makes me question the technical knowledge behind this project.
I appreciate that you may be a qualified Go developer but your grasp of server administration may be lacking if you’d even consider that response as one to be taken seriously.
@jonasfranz commented on GitHub (May 26, 2018):
@methodbox I don't see your point why a reverse proxy with no additional configuration should make a web application more secure. The only advantage might be that you could hide your gitea instance from the public. In addition you so called web server will be started also as root because no process could use a port <1024 without root permissions. I don not recommend running gitea as root but you could use other solutions like running gitea via docker which might be easier for not experienced user.
This project comes to you for free and the support many users are giving to you are also free.
@techknowlogick commented on GitHub (May 26, 2018):
To bind to a port below 1024, you can use setcap on Linux:
sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea.@methodbox commented on GitHub (May 28, 2018):
The reverse proxy is only part of the few steps to add additional security but an application should never run as its own web server, if nothing else.
Nginx is definitely going to be able to handle more requests than the Go service daemon, for example.
There’s also the benefit of something that can manage all kinds of different insecure header requests, block POST requests by default and the list goes on.
Your app server should never be your web server. There’s plenty of info out there in the Nodejs world that you can google if you want to learn more.
Here’s the first Reddit thread I found in a lazy google which has plenty of good reasons: https://www.reddit.com/r/node/comments/6b3voh/why_would_you_use_a_reverse_proxy_for_node/
That said, I missed a step in my Nginx server block - server_name - which seems to have resolved the issue.
@MiguelNdeCarvalho commented on GitHub (Mar 8, 2019):
Hey, I am having the same issue. Can you guys help me?
@techknowlogick commented on GitHub (Mar 8, 2019):
@MiguelNdeCarvalho perhaps this page could help you: https://docs.gitea.io/en-us/reverse-proxies/