404 for css/js files after Installation #5780

Closed
opened 2025-11-02 06:35:46 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @HerrHase on GitHub (Jul 24, 2020).

  • Gitea version (or commit ref): v1.12.2
  • Git version:
  • Operating system: 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)
    • No
    • Not relevant
  • Log gist:

Description

I have used the installation of your documentation for the binary https://docs.gitea.io/en-us/install-from-binary/, but after this, each asset give me a 404.

Screenshots

Screenshot at 2020-07-24 12-39-15

Originally created by @HerrHase on GitHub (Jul 24, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): v1.12.2 - Git version: - Operating system: 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) - [ ] No - [ ] Not relevant - Log gist: ## Description I have used the installation of your documentation for the binary https://docs.gitea.io/en-us/install-from-binary/, but after this, each asset give me a 404. ## Screenshots ![Screenshot at 2020-07-24 12-39-15](https://user-images.githubusercontent.com/5207733/88384012-e5662600-cdab-11ea-94d3-d0c8010eb784.png)
Author
Owner

@bryanpedini commented on GitHub (Jul 24, 2020):

How do you access the Gitea instance?

@bryanpedini commented on GitHub (Jul 24, 2020): How do you access the Gitea instance? - http://gitea.domain.tld:3000? - http://gitea.domain.tld with Nginx reverse proxy on http://localhost:3000 for example? - http://gitea.domain.tld with Nginx as reverse proxy on a Unix socket (`HTTP_ADDR = /var/run/gitea/gitea.sock` in `app.ini`)?
Author
Owner

@HerrHase commented on GitHub (Jul 24, 2020):

With a nginx reverse proxy. Try already some variants in the nginx configuration, but nothing changes.

@HerrHase commented on GitHub (Jul 24, 2020): With a nginx reverse proxy. Try already some variants in the nginx configuration, but nothing changes.
Author
Owner

@bryanpedini commented on GitHub (Jul 24, 2020):

With a nginx reverse proxy.

Did you follow either the official reverse proxy(es) guide (https://docs.gitea.io/en-us/reverse-proxies/) or a well-known good and working config example? I can drop a gist with mine if you need, I have both localhost:3000 config and Unix path, as I'm migrating the server from the first to the latter.

@bryanpedini commented on GitHub (Jul 24, 2020): > With a nginx reverse proxy. Did you follow either the official reverse proxy(es) guide (https://docs.gitea.io/en-us/reverse-proxies/) or a well-known good and working config example? I can drop a gist with mine if you need, I have both localhost:3000 config and Unix path, as I'm migrating the server from the first to the latter.
Author
Owner

@HerrHase commented on GitHub (Jul 25, 2020):

Both and i have gitea installed not the first time. I have build all assets from the source and serve them from another subdomain, that works. A gist would be great, maybe there is a hint what went wrong.

@HerrHase commented on GitHub (Jul 25, 2020): Both and i have gitea installed not the first time. I have build all assets from the source and serve them from another subdomain, that works. A gist would be great, maybe there is a hint what went wrong.
Author
Owner

@bryanpedini commented on GitHub (Jul 25, 2020):

There you have it, both work fine in their deployment, feel free to ask for any snippet I included if it isn't clear what it does: https://gist.github.com/bryanpedini/0ffa556abd742078c27e813b4fc9f6f2

@bryanpedini commented on GitHub (Jul 25, 2020): There you have it, both work fine in their deployment, feel free to ask for any snippet I included if it isn't clear what it does: https://gist.github.com/bryanpedini/0ffa556abd742078c27e813b4fc9f6f2
Author
Owner

@silverwind commented on GitHub (Jul 26, 2020):

Check your STATIC_URL_PREFIX configuration, it's what most assets use for their URL.

@silverwind commented on GitHub (Jul 26, 2020): Check your `STATIC_URL_PREFIX` configuration, it's what most assets use for their URL.
Author
Owner

@HerrHase commented on GitHub (Jul 27, 2020):

I have, but the best solution was to build all assets and place them in a sub directory. I tried the configuration from @bryanpedini but, the problem was the same, 404 errors for all assets. Thanks for your help!

@HerrHase commented on GitHub (Jul 27, 2020): I have, but the best solution was to build all assets and place them in a sub directory. I tried the configuration from @bryanpedini but, the problem was the same, 404 errors for all assets. Thanks for your help!
Author
Owner

@bryanpedini commented on GitHub (Jul 27, 2020):

I tried the configuration from @bryanpedini but, the problem was the same, 404 errors for all assets.

Both of the provided configurations work fine for me in both of my completely different servers...
Tho, I don't either serve files from a different subdomain nor a different directory than the standard /static/ (I think) from the Gitea server itself, so I can't help in that way. Maybe just use the Gitea instance static serving from the Golang server, no?

I'm sorry to not have been of enough help there...

@bryanpedini commented on GitHub (Jul 27, 2020): > I tried the configuration from @bryanpedini but, the problem was the same, 404 errors for all assets. Both of the provided configurations work fine for me in both of my completely different servers... Tho, I don't either serve files from a different subdomain nor a different directory than the standard /static/ (I think) from the Gitea server itself, so I can't help in that way. Maybe just use the Gitea instance static serving from the Golang server, no? I'm sorry to not have been of enough help there...
Author
Owner

@HerrHase commented on GitHub (Jul 27, 2020):

Ah, no Problem :) I only wondering why it didn't work for me in "basic" Version. But now its even faster with the static files ;-)

@HerrHase commented on GitHub (Jul 27, 2020): Ah, no Problem :) I only wondering why it didn't work for me in "basic" Version. But now its even faster with the static files ;-)
Author
Owner

@bryanpedini commented on GitHub (Jul 27, 2020):

I told ya'... use the Go server builtin static file serving... 😉

@bryanpedini commented on GitHub (Jul 27, 2020): I told ya'... use the Go server builtin static file serving... 😉
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5780