[GH-ISSUE #869] Ngnix FLAC not working #590

Closed
opened 2026-02-26 02:33:38 +03:00 by kerem · 3 comments
Owner

Originally created by @Miloune on GitHub (Dec 7, 2018).
Original GitHub issue: https://github.com/koel/koel/issues/869

Hello,

(PS: read my under comment)

I'm trying to setup koel with nginx following (https://github.com/phanan/koel/blob/master/nginx.conf.example) with x-accel-redirect as streaming method.
It's working with MP3 file but not with FLAC file. I think i misconfigured nginx since with "php artisan serve" it's working.

Content-Type is set to text/html when it's a Flac file.

I tried to add something like this in location /media/ in nginx configuration, but still not working

 if ($request_filename ~ "^.*\/(.+\.(flac))$"){
                        set $fname $1;
                        add_header Content-Disposition 'inline; filename="$fname"';
                        add_header Content-Type 'audio/mpeg';
                }

MP3 with nging (Working)

image

Flac with nginx (Not working)

image

Flac with php artisan serve (Working)

image

Originally created by @Miloune on GitHub (Dec 7, 2018). Original GitHub issue: https://github.com/koel/koel/issues/869 Hello, (PS: read my under comment) I'm trying to setup koel with nginx following (https://github.com/phanan/koel/blob/master/nginx.conf.example) with x-accel-redirect as streaming method. It's working with MP3 file but not with FLAC file. I think i misconfigured nginx since with "php artisan serve" it's working. Content-Type is set to text/html when it's a Flac file. I tried to add something like this in location /media/ in nginx configuration, but still not working ``` if ($request_filename ~ "^.*\/(.+\.(flac))$"){ set $fname $1; add_header Content-Disposition 'inline; filename="$fname"'; add_header Content-Type 'audio/mpeg'; } ``` ## MP3 with nging (Working) ![image](https://user-images.githubusercontent.com/8145119/49676443-0b757000-fa7a-11e8-9749-3f62e4203668.png) ## Flac with nginx (Not working) ![image](https://user-images.githubusercontent.com/8145119/49676414-f00a6500-fa79-11e8-82fc-e26d9bc6f244.png) ## Flac with php artisan serve (Working) ![image](https://user-images.githubusercontent.com/8145119/49676321-91dd8200-fa79-11e8-8af9-c0305c7aa158.png)
kerem closed this issue 2026-02-26 02:33:38 +03:00
Author
Owner

@Miloune commented on GitHub (Dec 8, 2018):

Ok, it's seem to not be a Nginx config.
I think it's related to https://github.com/phanan/koel/issues/561 and https://github.com/phanan/koel/issues/728

Some FLAC working, every non working FLAC files contains a non ASCII character in name or path.
All music from this albulm don't work: "/mnt/multimedia/Musiques/Indochine/La République des Meteors (2009)"

Another example:
Will not work: "/mnt/multimedia/Musiques/Indochine/13 (2017)/09 - Un Été français.flac"
Will work: "/mnt/multimedia/Musiques/Indochine/13 (2017)/14 - Trump le monde.flac"

<!-- gh-comment-id:445452908 --> @Miloune commented on GitHub (Dec 8, 2018): Ok, it's seem to not be a Nginx config. I think it's related to https://github.com/phanan/koel/issues/561 and https://github.com/phanan/koel/issues/728 Some FLAC working, every non working FLAC files contains a non ASCII character in name or path. All music from this albulm don't work: "/mnt/multimedia/Musiques/Indochine/La République des Meteors (2009)" Another example: Will not work: "/mnt/multimedia/Musiques/Indochine/13 (2017)/09 - Un Été français.flac" Will work: "/mnt/multimedia/Musiques/Indochine/13 (2017)/14 - Trump le monde.flac"
Author
Owner

@ARezaK commented on GitHub (Dec 9, 2018):

I was having the same problem. Had to rename some files and that fixed it

<!-- gh-comment-id:445563684 --> @ARezaK commented on GitHub (Dec 9, 2018): I was having the same problem. Had to rename some files and that fixed it
Author
Owner

@sijanec commented on GitHub (Mar 8, 2021):

Well that's not really a fix, is it?

<!-- gh-comment-id:793106475 --> @sijanec commented on GitHub (Mar 8, 2021): Well that's not really a fix, is it?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#590
No description provided.