You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Server static resources directly via webserver #12290
All static resources (as css, js, woff, woff2, svg, etc.) must be separated from PHP backend.
Because current solution very slow. (VPS 1 CPU, 2GB RAM, SSD Drive)
Actual behaviour
Most resources can't be returned as static files with Nginx.
Directive try_files $uri =404; always return 404 for most of files.
Server configuration
Operating system: Archlinux latest
Web server: Nginx 1.15.5
Database: PostgreSQL 10.5
PHP version: 7.2.11
Nextcloud version: 14.0.3
Updated from an older Nextcloud/ownCloud or fresh install: Fresh install
GitMate.io thinks possibly related issues are #2045 (Cronjob separate schedules), #10077 (Fix lazy search backend), #1666 (Download of files from backend not starting), #10203 (UpdateCalendarResourcesRoomsBackgroundJob fails if no backend available), and #433 (Remove static util from theming app).
This diff essentially un-does 29ff7ef for the "recent" icon, which indicates to me that the issue has something to do with the icon-color function. Unfortunately, I don't know much about scss.
Ah, this is making a little more sense. Without the diff in the previous comment, the generated css for .nav-icon-recent looks like this (un-minified):
The former is a 404, while the latter works. It seems core icons work, but the app ones do not (which again brings me back to wondering about webroot).
Backporting 845f1b6 and 152fb08 to stable14 actually fixes this (which makes sense given that they embed icons instead of trying to find them using the webroot)... but it fixes it for every icon except tags. Looking into why tags isn't working whoops, it was cached. Backport does indeed work.
Hmm... no, something is weird. The tag icon is broken on a fresh install every time, requiring a cache-clearing refresh to work. If I visit, say, settings, and come back, the sharing icon is broken now, and no refresh helps. In both of these cases the icon is set to none in CSS (i.e. there are no 404 network errors, etc.).
Ah ha, 0b2ef7e was needed as well. I'm willing to bet d21ded6 is, too-- basically a complete backport of #12016. Unfortunately that gets me test failures that I don't completely understand. That isn't the lightest approach anyway, it's not a small change; I feel like it should be possible to make icon-color work when apps are outside the webroot.
With latest version many static files can't be reached without PHP.
For some "static" resources it's required to serve them dynamically. Most of the theming related features. If you notice any other file with static content only provided through php please create a new report. Please refrain from creating a meta issue like "everything should be served static" and also keep note that your "files" always served dynamically.
With latest version many static files can't be reached without PHP.
For some "static" resources it's required to serve them dynamically. Most of the theming related features. If you notice any other file with static content only provided through php please create a new report. Please refrain from creating a meta issue like "everything should be served static" and also keep note that your "files" always served dynamically.
I find your language very aggressive. If you expect an answer from me (because you quote me) try to rephrase your comment in a less aggressive way. Also take a look at https://nextcloud.com/contribute/code-of-conduct/
I find your language very aggressive. If you expect an answer from me (because you quote me) try to rephrase your comment in a less aggressive way. Also take a look at https://nextcloud.com/contribute/code-of-conduct/
Yeah, you right. Sorry about this. https://gist.github.com/MrSorcus/4bdddac9c38b74d9b190335a467148ba - this is how Nextcloud return JS file. https://gist.github.com/MrSorcus/894d37b038c6b2dc8f66fbc8226e3edb - and this how Nginx return JS file.
PHP here is very slow. About 40 times slow then Nginx.
That's not good. And each request triggered database.
All dynamic data, specific to user, should be returned via API.
Or something similar. select2-toggleselect.js and mimetype.js is just a scripts.
There are not needed to resolve via PHP. Just take them back to user as static.
Other scripts / styles / images should be static too.
Except some variants where static not possible anyway.
Other scripts / styles / images should be static too.
Yes. It's a ongoing process. At some point in the future most of the scripts will be served statically. Feel free to submit patches to speed up the process. The current approach is to bundle most scripts with webpack.
Activity
nextcloud-bot commentedon Nov 5, 2018
GitMate.io thinks possibly related issues are #2045 (Cronjob separate schedules), #10077 (Fix lazy search backend), #1666 (Download of files from backend not starting), #10203 (UpdateCalendarResourcesRoomsBackgroundJob fails if no backend available), and #433 (Remove static util from theming app).
MorrisJobke commentedon Nov 5, 2018
cc @skjnldsv
MorrisJobke commentedon Nov 5, 2018
cc @juliushaertl
[-]Separate static from backend.[/-][+]Server static resources directly via webserver[/+]skjnldsv commentedon Nov 5, 2018
@rullzer 🏓
Talked to you about this ;)
Rello commentedon Nov 18, 2018
Hello,
I don´t know if this matches my case - but I think so.
My logs are full of 404s for all icons related to the files app
Core files on the other hand work - which makes NC look not too good
any idea how to fix it?

skjnldsv commentedon Nov 18, 2018
@Rello Hey!
Those urls should be forwarded through index.php. Is there anything that could prevent that in your settings?
Rello commentedon Nov 18, 2018
thats what I am trying to figure out but I have now idea where to look.
checked nginx config and logs. but have no idea...
skjnldsv commentedon Nov 19, 2018
@Rello can you post your settings! :)
Rello commentedon Nov 20, 2018
Hello,
nginx sites-available/default has exactly the same as this config (just ssl and nextcloud->owncloud replaced)
https://docs.nextcloud.com/server/14/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx
config.php is
Rello commentedon Nov 20, 2018
ok,
after testing the config.php against an empty clean NC install, the issue comes from
when I remove this section, its working perfectly fine. I am happy to have solved the issue - but ### WHY???
20 remaining items
kyrofa commentedon Dec 18, 2018
One of the many icons missing is the "recent" icon there on the left. If I apply this diff (to 14.0.4), the icon shows up:
This diff essentially un-does 29ff7ef for the "recent" icon, which indicates to me that the issue has something to do with the
icon-colorfunction. Unfortunately, I don't know much about scss.kyrofa commentedon Dec 18, 2018
Ah, this is making a little more sense. Without the diff in the previous comment, the generated css for .nav-icon-recent looks like this (un-minified):
Well, icons-vars.css has:
Whereas favorites, the one that works, is in core:
The former is a 404, while the latter works. It seems core icons work, but the app ones do not (which again brings me back to wondering about webroot).
kyrofa commentedon Dec 18, 2018
Backporting 845f1b6 and 152fb08 to stable14 actually fixes this (which makes sense given that they embed icons instead of trying to find them using the webroot)...
but it fixes it for every icon except tags. Looking into why tags isn't workingwhoops, it was cached. Backport does indeed work.kyrofa commentedon Dec 18, 2018
Hmm... no, something is weird. The tag icon is broken on a fresh install every time, requiring a cache-clearing refresh to work. If I visit, say, settings, and come back, the sharing icon is broken now, and no refresh helps. In both of these cases the icon is set to
nonein CSS (i.e. there are no 404 network errors, etc.).kyrofa commentedon Dec 18, 2018
Ah ha, 0b2ef7e was needed as well. I'm willing to bet d21ded6 is, too-- basically a complete backport of #12016. Unfortunately that gets me test failures that I don't completely understand. That isn't the lightest approach anyway, it's not a small change; I feel like it should be possible to make
icon-colorwork when apps are outside the webroot.skjnldsv commentedon Dec 18, 2018
@kyrofa if you access /index.php/svg/core/actions/star-dark/000?v=2 directly, what do you get?
kyrofa commentedon Dec 18, 2018
@skjnldsv it works fine, but
/index.php/svg/files/recent/000?v=1is a 404.juliusknorr commentedon Apr 16, 2019
Was fixed with #13224
MrSorcus commentedon Jan 30, 2020
Why issue closed?
With latest version many static files can't be reached without PHP.
kesselb commentedon Jan 30, 2020
I guess your issue got hijacked ;)
For some "static" resources it's required to serve them dynamically. Most of the theming related features. If you notice any other file with static content only provided through php please create a new report. Please refrain from creating a meta issue like "everything should be served static" and also keep note that your "files" always served dynamically.
MrSorcus commentedon Feb 2, 2020
Are you kidding me, right?Let me show you some links.
https://gist.github.com/MrSorcus/4bdddac9c38b74d9b190335a467148ba - this is how Nextcloud return JS file.
https://gist.github.com/MrSorcus/894d37b038c6b2dc8f66fbc8226e3edb - and this how Nginx return JS file.
WTF? 9 req/s VS 400 req/s... Are you serious?
PHP for static files is a BAD idea. Very bad.
And every request to static file triggered database...
Really? This is weird shit.
Add command to
occto generate some dynamic resources into static, but don't do that at runtime.cc @juliushaertl @skjnldsv @MorrisJobke
kesselb commentedon Feb 2, 2020
I find your language very aggressive. If you expect an answer from me (because you quote me) try to rephrase your comment in a less aggressive way. Also take a look at https://nextcloud.com/contribute/code-of-conduct/
MrSorcus commentedon Feb 2, 2020
Yeah, you right. Sorry about this.
https://gist.github.com/MrSorcus/4bdddac9c38b74d9b190335a467148ba - this is how Nextcloud return JS file.
https://gist.github.com/MrSorcus/894d37b038c6b2dc8f66fbc8226e3edb - and this how Nginx return JS file.
PHP here is very slow. About 40 times slow then Nginx.
That's not good. And each request triggered database.
All dynamic data, specific to user, should be returned via API.
Or something similar.
select2-toggleselect.jsandmimetype.jsis just a scripts.There are not needed to resolve via PHP. Just take them back to user as static.
Other scripts / styles / images should be static too.
Except some variants where static not possible anyway.
cc @juliushaertl @skjnldsv @MorrisJobke
kesselb commentedon Feb 2, 2020
Yes. It's a ongoing process. At some point in the future most of the scripts will be served statically. Feel free to submit patches to speed up the process. The current approach is to bundle most scripts with webpack.