Skip to content
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

fix(nginx): adjust config to changed ocm-provider #11179

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Oct 5, 2023

  • Since 27.1.2 and 26.0.8 ocm-provider is not a dir anymore, but implemented in a usual Controller. Nginx webserver config requires adjustments.

As noted in nextcloud/server#40745, for nextcloud/server#39574

- Since 27.1.2 and 26.0.8 ocm-provider is not a dir anymore, but
  implemented in a usual Controller. Nginx webserver config requires
  adjustemnts.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz
Copy link
Member Author

blizzz commented Oct 5, 2023

/backport to stable27

@blizzz
Copy link
Member Author

blizzz commented Oct 5, 2023

/backport to stable26

@blizzz
Copy link
Member Author

blizzz commented Oct 5, 2023

fyi @gonzalo- the openbsd httpd config also likely needs an update, but I am stumble at the % sign around the pattern and am not sure to do the change correctly.

@blizzz blizzz requested a review from kesselb October 5, 2023 09:57
@gonzalo-
Copy link
Contributor

gonzalo- commented Oct 5, 2023

You can take the example from our port in OpenBSD:

https://cvsweb.openbsd.org/ports/www/nextcloud/pkg/README?rev=1.22&content-type=text/x-cvsweb-markup

@blizzz
Copy link
Member Author

blizzz commented Oct 5, 2023

You can take the example from our port in OpenBSD:

https://cvsweb.openbsd.org/ports/www/nextcloud/pkg/README?rev=1.22&content-type=text/x-cvsweb-markup

I do not know how to treat the % in /nextcloud/oc[ms]%-provider/

@blizzz blizzz merged commit 3b88a8e into master Oct 5, 2023
8 checks passed
@blizzz blizzz deleted the fix/noid/adjust-nging-ocm-prov branch October 5, 2023 10:07
@gonzalo-
Copy link
Contributor

gonzalo- commented Oct 5, 2023

I do not know how to treat the % in /nextcloud/oc[ms]%-provider/

%n
The capture index n of a string that was captured by the enclosing location match option.

If ocm-provider doesn't exist anymore you can just let the existing one only and delete the whole []%

@blizzz
Copy link
Member Author

blizzz commented Oct 5, 2023

I do not know how to treat the % in /nextcloud/oc[ms]%-provider/

%n The capture index n of a string that was captured by the enclosing location match option.

If ocm-provider doesn't exist anymore you can just let the existing one only and delete the whole []%

Thanks! PR by @ArtificialOwl in #11184

Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Oct 9, 2023
First of all, a few cleanups were made to make it more readable:

* Reordered the sections by their priority so what you're reading in Nix
  is also what you get in the final nginx.conf.
* Unified media/asset locations

Most notably, this fixes the

    Your web server is not properly set up to resolve "/ocm-provider/".

warning since 27.1.2 where `ocm-provider` was moved from a static
directory in the source tarball to a dynamic HTTP route[1].

Additionally, the following things were fixed:

* The 404 checks for build/tests/etc. are now guaranteed to be before
  the `.php` location match and it's not implicitly relied upon Nix's
  internal attribute sorting anymore.

* `.wasm` files are supported properly and a correct `Content-Type` is
  set.

* For "legacy" routes (e.g. `ocs-provider`/`cron`/etc) a `rewrite` rule
  inside the location for fastcgi is used as recommended by upstream[2].
  This also makes it easier to understand the purpose of the location
  itself (i.e. use fastcgi for PHP code).

[1] nextcloud/documentation#11179
[2] https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html
ryantm pushed a commit to ryantm/nixpkgs that referenced this pull request Oct 13, 2023
First of all, a few cleanups were made to make it more readable:

* Reordered the sections by their priority so what you're reading in Nix
  is also what you get in the final nginx.conf.
* Unified media/asset locations

Most notably, this fixes the

    Your web server is not properly set up to resolve "/ocm-provider/".

warning since 27.1.2 where `ocm-provider` was moved from a static
directory in the source tarball to a dynamic HTTP route[1].

Additionally, the following things were fixed:

* The 404 checks for build/tests/etc. are now guaranteed to be before
  the `.php` location match and it's not implicitly relied upon Nix's
  internal attribute sorting anymore.

* `.wasm` files are supported properly and a correct `Content-Type` is
  set.

* For "legacy" routes (e.g. `ocs-provider`/`cron`/etc) a `rewrite` rule
  inside the location for fastcgi is used as recommended by upstream[2].
  This also makes it easier to understand the purpose of the location
  itself (i.e. use fastcgi for PHP code).

[1] nextcloud/documentation#11179
[2] https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html
ryantm pushed a commit to ryantm/nixpkgs that referenced this pull request Oct 13, 2023
First of all, a few cleanups were made to make it more readable:

* Reordered the sections by their priority so what you're reading in Nix
  is also what you get in the final nginx.conf.
* Unified media/asset locations

Most notably, this fixes the

    Your web server is not properly set up to resolve "/ocm-provider/".

warning since 27.1.2 where `ocm-provider` was moved from a static
directory in the source tarball to a dynamic HTTP route[1].

Additionally, the following things were fixed:

* The 404 checks for build/tests/etc. are now guaranteed to be before
  the `.php` location match and it's not implicitly relied upon Nix's
  internal attribute sorting anymore.

* `.wasm` files are supported properly and a correct `Content-Type` is
  set.

* For "legacy" routes (e.g. `ocs-provider`/`cron`/etc) a `rewrite` rule
  inside the location for fastcgi is used as recommended by upstream[2].
  This also makes it easier to understand the purpose of the location
  itself (i.e. use fastcgi for PHP code).

[1] nextcloud/documentation#11179
[2] https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html
Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Dec 26, 2023
First of all, a few cleanups were made to make it more readable:

* Reordered the sections by their priority so what you're reading in Nix
  is also what you get in the final nginx.conf.
* Unified media/asset locations

Most notably, this fixes the

    Your web server is not properly set up to resolve "/ocm-provider/".

warning since 27.1.2 where `ocm-provider` was moved from a static
directory in the source tarball to a dynamic HTTP route[1].

Additionally, the following things were fixed:

* The 404 checks for build/tests/etc. are now guaranteed to be before
  the `.php` location match and it's not implicitly relied upon Nix's
  internal attribute sorting anymore.

* `.wasm` files are supported properly and a correct `Content-Type` is
  set.

* For "legacy" routes (e.g. `ocs-provider`/`cron`/etc) a `rewrite` rule
  inside the location for fastcgi is used as recommended by upstream[2].
  This also makes it easier to understand the purpose of the location
  itself (i.e. use fastcgi for PHP code).

[1] nextcloud/documentation#11179
[2] https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html

(cherry picked from commit ad57ad1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants