reverse proxying Shinobi with nginx



  • Re: how to reverse proxy shinobi

    I managed to have shinobi running on my lan, and captured flux from my cheap chinese ip cam all right (Gadinan), so a great start and I will start explore what I can do for auto-record, alarms and so on...
    When trying to access shinobi from the web though, I have what seems to be a common issue: I try to expose it through nginx reverse proxy, which is nice as it is the single https entry to my LAN and gives me the opportunity to gather all my home stuff on a welcome page. The examples I have found on the web seems straightforward enough, very similar to other http/ws proxies I have:

    location /shinobi/ {
             proxy_pass http://192.168.0.???:8080/;
             proxy_http_version 1.1;
             proxy_redirect off;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_set_header X-Forward-Proto http;
             proxy_set_header Host $http_host;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection "upgrade";
             proxy_set_header X-NginX-Proxy true;
             proxy_set_header X-Real-IP $remote_addr;
    }
    

    ??? is changed to my shinobi server. It partially works, I have access to the shinobi login and dashboard, but without any formatting like if CSS files are not found or something.

    Seems like other encountered exactly the same issue, and it is linked to the way shinobi define URLs. The problem is known, but I have not found solutions yet, and my attempts tomodify the proxy options above (based on different examples found on the net) did not succeed, always the same issue of partial rendering without any formatting/images/...

    Any tips to solve this?



  • After spending some efforts on this, I have to conclude that it is not possible at the moment, ut's something that must be added to shinobi configuration (like use_base_url="/base_url/"). I managed (with sub_filter help) to display the shinobi interface, but not the video fluxes. subs_filter did not help, even with some use of regexps. I did fall back to creating a new server name, and proxy root url, it's working nicely like that. Not optimal, I would prefer to expose all of my stuff through a single external server, but without base_irl support it's the best I can do....


 

Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.