Multiple Web Interfaces Behind Nginx Reverse proxy
#1
Hello,
I have muliple intances of kodi running inside my house, i use the web interface to control them regularly. 
I recently decided i wanted to run a small web server and reserse proxy to better orginize my different web interfaces and other portals.

I have tried to get even 1 kodi web interface working and i can not. I have every other portal now configured with nginx but kodi's web interface (and the reason i started) wont work. I am currently just trying to set up the first one, i call Kodi-alpha. id like to access it at mydomain.com/kodi-alpha/ but no matter what i do it just shows a blank white page with"file not found" kodi alpha is the localhost and is configured 

my nginx proxy entery for the kodi-alpha looks like this


    location /kodi-alpha/ {
     proxy_set_header    Host $http_host;
    proxy_set_header    X-Real-IP $remote_addr;
    proxy_set_header    X-Scheme $scheme;
    proxy_pass          http://127.0.0.1:8080/;
    proxy_http_version  1.1;
    proxy_set_header    Upgrade $http_upgrade;
    proxy_set_header    Connection "upgrade";
    }

and it loads up, and even prompts for password, but then goes to a white blank page that reads "File Not Found'


Id really like to figure this out as in the long run i want to have a few others set up,
mydomain.ca/kodi-alpha
mydomain.ca/kodi-beta
mydomain.ca/kodi-gamma
mydomain.ca/kodi-HomeTheater
mydomain.ca/kodi-Livingroom
but i need to figure out what i am doing wrong. currently alpha is the local host. the rest are on other computers but they all seem to be doing the same thing
Reply
#2
The web interfaces uses a websocket connection for json rpc. You probably need to proxy that as well.
You can open developer tools in your browser to better observe(via network tab) what's going on.
Reply
#3
(2021-08-17, 08:59)wsnipex Wrote: The web interfaces uses a websocket connection for json rpc. You probably need to proxy that as well.
You can open developer tools in your browser to better observe(via network tab) what's going on.

After some fidling and googling i found a solution.
location /Kodi-Alpha/ {
                    proxy_set_header    Host $http_host;
                    proxy_set_header    X-Real-IP $remote_addr;
                    proxy_set_header    X-Scheme $scheme;
                    proxy_pass          http://192.168.2.10:8080/;
                    proxy_http_version  1.1;
                    proxy_set_header    Upgrade $http_upgrade;
                    proxy_set_header    Connection "upgrade";
      }

                        location ~ ^/(image|jsonrpc) {
                            proxy_pass http://192.168.2.10:8080;
                            proxy_redirect off;
                            proxy_set_header Host 192.168.2.10:$server_port;
                            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                            proxy_set_header X-Forwarded-Ssl off;
                  }

i had to hard code the host header in the jsonrcp to allow everthing to work, otherwise i was getting mixed interfaces between my installed but now it seems to work thanks for the help.
Reply
#4
i regret to say that while it does seem to work every so often it often still shows mixed information on the interface. i recognise at that this might not be the right place but any help would be appreciated.
Reply



Logout Mark Read Team Forum Stats Members Help
Multiple Web Interfaces Behind Nginx Reverse proxy0
This forum uses Lukasz Tkacz MyBB addons.