Plugins assets not loading in panel


#1

first time running kirby in an apache server with nginx being used as reversed proxy.

i managed to make everything work, the only thing not working is some plugins, for example simplemde and sortable.

i get an error in the browser console saying

Loading failed for the <script> with source “https://website.org/panel/plugins/js?v=2.5.12”.

I imagine this is due to the way those scripts are being loaded from the plugin, or the way kirby panel loads those plugins dependencies? Tried to browse a bit the forum but did not find anything.

any suggestion? Is it a kirby panel general problem?

thanks,
André


#2

Wondering if this is maybe part of the kirby nginx-specific rules I took out when I added apache as main server, but I should maybe put back. Trying now.

EDIT: nope


#3

Tried to change folder permissions of the kirby site/plugins folder to be owned by the apache user, but still not working.

And indeed the plugins are loaded and working, just the script file is not loaded.

I read the panel cannot load js files per se, except if loaded through a routing url? Could this be the reason?


#4

OK, reading at the nginx error log, it says

2019/01/04 09:54:35 [error] 31413#31413: *165 open() "/path/to/kirby/panel/plugins/js" failed (2: No such file or directory), 
client: xxx.xx.xx.xx, 
server: website.org, 
request: "GET /panel/plugins/js?v=2.5.12 HTTP/1.1", 
host: "website.org", referrer: "https://website.org/panel/pages/name/edit"

it’s a url problem therefore. there is no plugins/js folder under panel.

in my local environment though, the /panel/plugins/js?v=2.5.12 GET request works fine.

I came across this post Kirby Panel not working behind reverse proxy setup where they both mention to use https://getkirby.com/docs/cheatsheet/options/url and https://github.com/gnif/mod_rpaf.

I tried both options with no good result, the panel still does not load css and js files coming from the plugins.


#5

so, i came to the conclusion that my server setup is working fairly well. i tested everything i could find relatable to serve the correct urls and resources from apache to nginx and vice versa.

as the panel works fine, the panel urls do work fine as well, it seems it’s only the way that kirby panel routes the GET request to fetch the bundled js and css assets of all the plugins installed in the panel (this is what i learned). any hint on a workaround for this, or a solution, would be highly appreciated!

i wanna keep the apache + nginx server setup to see how well it works, rather than giving up on nginx and stick with apache only (or vice versa).

i’m sure i’m not the only one in need of this, for example people using docker and having to bind the docker instance to the server port, etcetera.

thanks! :innocent::smiling_face_with_three_hearts: