[GH-ISSUE #153] Doesn't work when running from sub directory. #108

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

Originally created by @myagmarsurensedjav on GitHub (Dec 28, 2015).
Original GitHub issue: https://github.com/koel/koel/issues/153

Hello!

I'm using on my local network. My base url is http://192.168.1.8/songs/ . In this case has an url problem like http://192.168.1.8/css/app.css it should be http://192.168.1.8/songs/css/app.css

Originally created by @myagmarsurensedjav on GitHub (Dec 28, 2015). Original GitHub issue: https://github.com/koel/koel/issues/153 Hello! I'm using on my local network. My base url is http://192.168.1.8/songs/ . In this case has an url problem like http://192.168.1.8/css/app.css it should be http://192.168.1.8/songs/css/app.css
kerem closed this issue 2026-02-26 02:32:09 +03:00
Author
Owner

@phanan commented on GitHub (Dec 28, 2015):

Koel doesn't run from a subdir.

<!-- gh-comment-id:167563728 --> @phanan commented on GitHub (Dec 28, 2015): Koel doesn't run from a subdir.
Author
Owner

@kopf commented on GitHub (Sep 23, 2019):

Koel doesn't run from a subdir.

Hi @phanan - is this still the case in v4.0.0 ?

<!-- gh-comment-id:534274787 --> @kopf commented on GitHub (Sep 23, 2019): > Koel doesn't run from a subdir. Hi @phanan - is this still the case in v4.0.0 ?
Author
Owner

@ettingshausen commented on GitHub (Oct 6, 2023):

We can use NGINX rewrite and sub_filter tricks.
It works for me.

location /koel/ {
    proxy_set_header Accept-Encoding '';
    proxy_set_header Host $http_host;
    rewrite ^/koel(/.*)$ $1 break;
    proxy_pass http://127.0.0.1:80;
    sub_filter_once off;
    sub_filter_types *;
    sub_filter 'http://your-domain.com:8080/' './';
    sub_filter 'http:\/\/your-domain.com:8080\/' 'https:\/\/your-domain.com:8080\/koel\/';
    sub_filter 'return"/build/"+e' 'return"/koel/build/"+e';
    sub_filter '/build/assets/' './build/assets/';
    sub_filter '/#/profile' './#/profile';
    sub_filter '/#/visualizer' './#/visualizer';
 }
<!-- gh-comment-id:1750997276 --> @ettingshausen commented on GitHub (Oct 6, 2023): We can use NGINX `rewrite` and `sub_filter` tricks. It works for me. ``` location /koel/ { proxy_set_header Accept-Encoding ''; proxy_set_header Host $http_host; rewrite ^/koel(/.*)$ $1 break; proxy_pass http://127.0.0.1:80; sub_filter_once off; sub_filter_types *; sub_filter 'http://your-domain.com:8080/' './'; sub_filter 'http:\/\/your-domain.com:8080\/' 'https:\/\/your-domain.com:8080\/koel\/'; sub_filter 'return"/build/"+e' 'return"/koel/build/"+e'; sub_filter '/build/assets/' './build/assets/'; sub_filter '/#/profile' './#/profile'; sub_filter '/#/visualizer' './#/visualizer'; } ```
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#108
No description provided.