Issue on proxy with sub folder path - Relative path of JS scripts

We are managing the nginx to proxy the kiwi.

It is reachable at https://poliham.deib.polimi.it/145m2ms1/

Accessing to you will receive the alert on the wrong JS loaded.

After some investiagtion it seems related to the wrong path in some JS parts that is not taking care of the complete path.

Could you confirm that? Any way to fix it?

We've also included a workaround for the ./kiwi path, but a cleaner solution is obviously more effective.

73,


GL

Comments

  • Yeah, you've got some serious cache configuration issues. Look at the browser network tracing below for your Kiwi versus one of mine. The VER file is supposed to return JSON and not be cached. Why are you returning your welcome HTML content?

    That's why you're seeing "vundefined.undefined: KiwiSDR server" in the page output. That's the result of the JSON parsing failing (I should obviously display a better error message in that case).

    So use the browser network debugger compared to a working Kiwi to get your proxy setup correctly.




  • edited October 13

    John, many thanks for your analysis.

    Unfortunately, the call of kiwi_load2 through kiwi_ajax is addressed to the base url /VER and the path is generated by this code.

    It should be "https://poliham.deib.polimi.it/145m2ms1/VER" but the requested url is "https://poliham.deib.polimi.it/VER" ignoring the full path including the subfolder.

    I'm wrong?

    The proxy replies with the default page because the path is outside the subfolder dedicated to the Kiwi.

    If you are aware of any Kiwi running with a subfolder path as we have, then the comparison will help a lot. At the moment I was unable to find any similar deployment.

  • Okay, I didn't understand what you were saying initially.

    I changed the ajax path from the absolute path of /VER to just the relative path of VER. And everything seemed to work. But I'm not planning a new release anytime soon where this change could be made. But I see you must have a nginx rule or something now to work around the problem.

    I think /VER should be the only one like this. Do you think there are any others? I couldn't find any after a brief check.

  • Here the workaround, so you will see all the paths impacted as far as I've found.


    location = /VER {

      include /config/nginx/proxy.conf;

      set $upstream_app 192.168.20.10;

      set $upstream_port 8073;

      set $upstream_proto http;

      proxy_set_header Upgrade $http_upgrade;

      proxy_set_header Connection "upgrade";

      proxy_set_header Host $host;

      proxy_pass $upstream_proto://$upstream_app:$upstream_port/VER;

    }



    location ~/kiwi/(.*) {

      include /config/nginx/proxy.conf;

      set $upstream_app 192.168.20.10;

      set $upstream_port 8073;

      set $upstream_proto http;

      proxy_set_header Upgrade $http_upgrade;

      proxy_set_header Connection "upgrade";

      proxy_set_header Host $host;

      proxy_pass $upstream_proto://$upstream_app:$upstream_port/kiwi/$1;


    }


    location ~/pkgs/(.*) {

      include /config/nginx/proxy.conf;

      set $upstream_app 192.168.20.10;

      set $upstream_port 8073;

      set $upstream_proto http;

      proxy_set_header Upgrade $http_upgrade;

      proxy_set_header Connection "upgrade";

      proxy_set_header Host $host;

      proxy_pass $upstream_proto://$upstream_app:$upstream_port/pkgs/$1;

    }


    location ~/extensions/(.*) {

      include /config/nginx/proxy.conf;

      set $upstream_app 192.168.20.10;

      set $upstream_port 8073;

      set $upstream_proto http;

      proxy_set_header Upgrade $http_upgrade;

      proxy_set_header Connection "upgrade";

      proxy_set_header Host $host;

      proxy_pass $upstream_proto://$upstream_app:$upstream_port/extensions/$1;

    }

Sign In or Register to comment.