Error messages
Failed to load asset files from http://DOMAIN/assets/js/index.js?v=1.23.5. Please make sure the asset files can be accessed.

network tab gitea error

In Chromium/Chrome Network tab it show net::ERR_INCOMPLETE_CHUNKED_ENCODING as error messages.

Solution 1: Permission Issue

I put the Gitea behind Nginx reverse proxy, so let’s check what is the real error messages from Nginx error logs

2025/03/17 14:26:02 [crit] 2196#2196: *3 open() "/var/cache/nginx/proxy_temp/2/00/0000000002" failed (13: Permission denied) while reading upstream, client: 114.114.114.114, server: gitea.prd.atetux.com, request: "GET /assets/js/index.js?v=1.23.5 HTTP/1.1", upstream: "http://127.0.0.1:3000/assets/js/index.js?v=1.23.5", host: "gitea.prd.atetux.com"

it says the permission denied, that mean the nginx run as certain user, but the user unable to create files in that specific path. Get the file permission

$ sudo ls -lah  /var/cache/nginx/
total 28K
drwxr-xr-x  7 root     root 4.0K Feb  9 14:05 .
drwxr-xr-x 16 root     root 4.0K Feb  9 14:02 ..
drwx------  2 www-data root 4.0K Feb  9 14:05 client_temp
drwx------  2 www-data root 4.0K Feb  9 14:05 fastcgi_temp
drwx------ 12 www-data root 4.0K Feb 11 05:52 proxy_temp
drwx------  2 www-data root 4.0K Feb  9 14:05 scgi_temp
drwx------  2 www-data root 4.0K Feb  9 14:05 uwsgi_temp

from information above, the default cache for nginx /var/cache/nginx own by user www-data and group root. Check the nginx user first

$ grep -w user /etc/nginx/nginx.conf
user  www-data;
# get information about user www-data
$ id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)

The user www-data only had www-data as the group, change the ownership of those folder to own by www-data

$ sudo chown www-data:www-data -R /var/cache/nginx/

Solution 2: Add proxy buffer

Other that because the permission issue, those error messages happen because the proxy_buffer is full, then nginx try to save it to temporary file. Increase the proxy_buffer should fix the issue as well
This is the current nginx config for my gitea

location / {
   proxy_set_header X-Real-IP $remote_addr;
   proxy_pass http://127.0.0.1:3000/;
}

update with

location / {
   proxy_buffers 8 1024k;
   proxy_buffer_size 1024k;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_pass http://127.0.0.1:3000/;
}

then restart the nginx.

Leave a comment

Your email address will not be published. Required fields are marked *