New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/nextcloud: update nginx config #95508
Conversation
This patch ensures that latest Nextcloud works flawlessly again on our `nginx`. The new config is mostly based on upstream recommendations (again)[1]: * Trying to access internals now results in a 404. * All `.php`-routes get properly resolved now. * Removed 404/403 handling from `nginx` as the app itself takes care of this. Also, this breaks the `/ocs`-API. * `.woff2?`-files expire later than other assets like images. Closes NixOS#95293 [1] https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
Already deployed this to my own instance successfully btw :) |
Yay, thanks! My Nextcloud instance is still on 20.03, so I need to find a few minutes tonight to port those changes for testing. |
@mweinelt AFAIK the merge-conflict should only be caused by indentation changes that were needed after the removal of |
Noted, will give it a try after dinner. |
That does look alot better already! One error in the Nextcloud logs is still there:
That files is located at That being said, I don't see the related error in the Firefox networking tab. |
Will take a look tomorrow :) |
@Ma27 unfortunately I'm a |
@mweinelt it seems as I don't have any |
It's a separate app that needs to be installed. https://apps.nextcloud.com/apps/maps I'm on 19.0.1, so pretty recent. And as I noted in the issue this is a generic issue with apps. {
"reqId":"rcySgiTQDl5IDxC64Oin",
"level":3,
"time":"2020-08-16T12:30:27+00:00",
"remoteAddr":"80.135.0.0",
"user":"hexa",
"app":"lib",
"method":"GET",
"url":"/apps/gpxedit/",
"message":"ResourceLocator can not find a web root (root: /var/lib/nextcloud/store-apps/gpxedit, file: css/gpxedit/fab1-14bb-Leaflet.LinearMeasurement.css?v=966826b4e0c8f3f79aed96cd8fa5a4a3, webRoot: , throw: true)",
"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0",
"version":"19.0.1.1"
} The file in question is located at
|
I don't understand though why the CSS file lands in the datadirectory and not in the (writable) This seems to be an internal Nextcloud problem though (that doesn't mean that it isn't NixOS-related) which would also explain why you don't have any errors in your browser console. One symptom I see btw is that the maps are just white without any additional info, maybe that's caused by this error. Unfortunately I don't know the app-installer well enough. Do you want to take a look? Otherwise I can investigate further at some point in the next week(s). |
Maybe it's being generated during install, rendered from `store-apps/maps/css/Leaflet.LinearMeasurement.scss and auto-generated stuff lands in the appdata directory? It also has this weird name that looks like they want to prevent caching. Not sure where it comes from. I've scrolled through the source code of both nextcloud/server and nextcloud/maps but I'm not sure where any of this is happening. |
I propose merging this PR, and debugging the issue with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major QOL improvement. Thanks!
@Ma27 Will you take care of the backport? |
Motivation for this change
This patch ensures that latest Nextcloud works flawlessly again on our
nginx
. The new config is mostly based on upstream recommendations(again)[1]:
.php
-routes get properly resolved now.nginx
as the app itself takes care ofthis. Also, this breaks the
/ocs
-API..woff2?
-files expire later than other assets like images.Closes #95293
[1] https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)