-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Update Nginx config according to feedback #1292
Conversation
/backport to stable15 |
@MorrisJobke I wasnt sure if return 301 was better in this case, was wondering if @BernieO could chime in. But, if we are going the return 301 route, then I think it makes sense to just go all the way and use 2 "location =". Give me a few minutes and I'll write up what I think could work. |
I chose a rewrite, because 301 are stored in the Browsers cache. I thought a good idea would be to not fill up the Browsers caches with 301 redirects to everything under /oc(m|s)-provider (dunno, whether much is there or not, though) EDIT: actually: if Nextcloud resides in a subfolder - will there also be requests for e.g. |
Makes sense. Then I suggest the configuration below. Could someone test to confirm? Thank you
|
A trailing slash at the end of the location is needed - otherwise the warning in the admin panel does not disappear.
Let me know, if I should I open a new pull request? |
Makes sense. I wonder if in practice clients using these endpoint use /ocm-provider/ or /ocm-provider/index.php If either is supposed to work, then maybe we should keep this as a rewrite. |
I agree - this is what I meant with my EDIT above. |
Hmm, I do not think @BernieO are you saying you can GET /ocm-provider/index.php with |
Now that I familiarized myself further with the config (been a while since I looked at it!), I realize we already tried to handle this with the below location.
I am wondering if the admin panel is just not handling the webroot correctly in its test? The only reason we need to define the /.well-known locations is because they are part of a specs outside of Nextcloud. Any ownCloud/Nextcloud clients should be able to know how to handle a non-standard webroot properly once you tell them your instance is located at https://example.com/nextcloud. So, my hypothesis is, this is a bug in the admin panel, which should be fixed in its code. In that case #1280 would not be necessary. Please correct me if you find a mistake in my logic. |
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.
Fine for me as well
Before we move forward with this PR, can we confirm if the spec requires that |
No, that doesn't work. When using an exact location match ( If a request for /ocm-provider/index.php needs to deliver /nextcloud/ocm-provider/index.php we probably need to stick to the regex-rewrite like:
But I agree with @josh4trunks that we need to check first whether the ocm-/ocs-specs require that
|
Yes it works fine if installed to the web root. Also the checks just return fine. The code for the check is in here: This was added in nextcloud/server#14255 and @schiessle defined it there like this: nextcloud/server#14247 (comment) So it seems that the standard requires it to be served with the trailing slash. @schiessle Could you elaborate on this one? |
Also the |
@MorrisJobke @schiessle |
Ok, would https://www.example.com/ocm-provider/index.php or https://www.example.com/nextcloud/ocs-provider/index.php ever be expected to work? |
Sorry - it seems to be number 2. But let's wait for @schiessle to clarify on this. The setup check does it at least for 2. |
Ok, sounds good. |
@schiessle when you have a chance to help clarify what URL ocm-provider & ocs-provider are expected to be at on a server hosted at https://www.example.com/nextcloud we can do the rest =] |
My understanding is this can be closed. Thanks everyone |
Correct 👍 |
cc @josh4trunks @BernieO
ref #1280