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

Ampache api with nextcloud served by nginx gets 404 when following nextclou admin docs #851

Open
aleixq opened this issue May 1, 2021 · 8 comments

Comments

@aleixq
Copy link

aleixq commented May 1, 2021

Setting nginx site as it's explained in nextcloud administration docs for nginx: https://docs.nextcloud.com/server/21/admin_manual/installation/nginx.html , the php location block breaks ampache api as it splits the path from last ".php" found (xml.server.php) using fastcgi_split_path_info ^(.+?\.php)(/.*)$ .
Using https://example.org/index.php/apps/music/ampache/server/xml.server.php works...

@paulijar
Copy link
Collaborator

paulijar commented May 2, 2021

Thanks for the info. Do you have some suggestion, what should be changed in the Music app? Or is the point that the Nextcloud admin docs should not be followed?

@aleixq
Copy link
Author

aleixq commented May 3, 2021

Paul, as ampache api endpoint of music app follows the specification of ampache docs, I think the only way is to add a new location block or tweaking the php handler block in nginx conf. I am gonna test later which one helps there.

@aleixq
Copy link
Author

aleixq commented May 4, 2021

What is working for me is replacing try_files directive of php handler specified in https://docs.nextcloud.com/server/21/admin_manual/installation/nginx.html#nextcloud-in-the-webroot-of-nginx :

--- nextcloud-old.conf  2021-05-05 01:02:35.871870022 +0200
+++ nextcloud.conf      2021-05-05 01:03:11.491904219 +0200
@@ -113,7 +113,7 @@
         fastcgi_split_path_info ^(.+?\.php)(/.*)$;
         set $path_info $fastcgi_path_info;
 
-        try_files $fastcgi_script_name =404;
+        try_files $fastcgi_script_name /index.php$fastcgi_script_name?$args;
 
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

But as it touches the main php handler of the whole nextcloud maybe there are some problems somewhere ...

@pled
Copy link

pled commented Jun 30, 2024

HI,
Same issue here using Docker Nextcloud 29 + Swag containers (Swag is nginx+fail2ban+letencrypt, from linuxserver.io).
I get the same error when trying to connect Power Ampache 2 Android app. to Nextcloud Music App.

I can see this issue open for 3 years, does that mean it will not be fixed ?

@paulijar
Copy link
Collaborator

@pled I don't believe that there's anything that the Music app could do to help the situation if the problem is in the nginx configuration. Frankly, configuring web servers has always seemed to me to be like some kind of black magic and I have a bit hard time following, what's the root cause of this issue.

@lachlan-00
Copy link

nextcloud is stripping the .php from the url?

You could probably just set a new location in the config for the server

    location /apps/music/ampache/server/ {
    }

and then remove the fastcgi_split_path_info or copy the default settings without it into the folder

(DISCLAIMER that i have no idea how to use nginx)

@pled
Copy link

pled commented Jul 1, 2024

@paulijar : yes, I agree this is related to nginx configuration and not Music App.

And looking at that nextcloud documentation page, it is mentionned that only Apache is officially supported.
Nginx configuration examples are community-maintained...

Nevertheless, applying the try_files directive suggested by @aleixq makes Power Ampache able to connect to Nextcloud Music app.
So may be the above documentation could be amended with that issue in the Tip and tricks section ? Not sure who and how to contact someone about this... I am sure nginx is widely used, specially with docker Nextcloud implementations.

@paulijar
Copy link
Collaborator

paulijar commented Jul 1, 2024

I suspect that https://github.com/nextcloud/documentation/issues would be the correct place to request changes/additions to the Nextcloud documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants