The forum is read-only currently.

2x KiwiSDR's on one real IP with same port

Hello guys, I try published 2 KiwiSDR receiver with using one real IP and using same port (8073) with Raspberry Pi3 and Nginx.
My topology:


On first step I created 2 different domain name in DNS, on my example it's kiwi.mydomain.com and kiwi2.mydomain.com (A or CNAME) with my real IP address 142.93.129.90
Second step, - on KiwiSDR1 configure SDR.hu registration to "Yes" and on connection add Next Kiwi URL redirect to http://kiwi2.mydomain.com:8073, on KiwiSDR2 configure SDR.hu registration to "No"
Next step, - install and configure Nginx on Raspberry Pi3:
  • sudo apt update && sudo apt -y upgrade
  • sudo apt install -y nginx
change Nginx config file (my example):
  • sudo nano /etc/nginx/sites-available/default
upstream kiwi1 {
server 192.168.1.3:8073;
server 192.168.1.4:8073 backup;
}

upstream kiwi2 {
server 192.168.1.4:8073;
server 192.168.1.3:8073 backup;
}

server {
listen 8073;
server_name kiwi.mydomain.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header realip $remote_addr;

location / {
proxy_pass http://kiwi1;
}
}

server {
listen 8073;
server_name kiwi2.mydomain.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header realip $remote_addr;

location / {
proxy_pass http://kiwi2;
}
}


I use second KiwiSDR for backup main in upstreams for best site stability.

Test configure: sudo nginx -t and if it's correct restart Nginx: sudo /etc/init.d/nginx restart, if you don't want close established connections you can use sudo /etc/init.d/nginx reload

Final step, - published Raspberry Pi3 on router like one of the KiwiSDR and start for testing connection.

The End :smile:

Troubles:
KiwiSDR see real IP of connected clients but don't use time limits for it:


Maybe any ideas how fix it?

PS you can start gzip compression on Nginx for low bandwidth connection.
PSS off course you can use more than 2 KiwiSDR with simple correction of this config.
Powernumpty

Comments

  • Been meaning to use Nginx for something else but couldn't find a good reason to spend personal time on it...
    Now I have the motivation, thanks.
  • jksjks
    edited August 2019
    Why all the complexity? You can have the first Kiwi at 192.168.1.2:8073 and have it URL redirect to 192.168.1.3:8074

    The latest Kiwi versions do JS/html/css minify and gzip of multiple file types (if advantageous) on the static parts of the interface (JS, html, css, png/jpg) [Funny how no one has mentioned how much faster things load these days]. Ngnix might help with the SND and W/F streams though. Will it do that given they are web socket streams? It better be lossless compression so as not to upset Kiwi SND compression if enabled (the default) since that encoding can't tolerate any bit errors.

    This post might be way off base because I just got off a long plane flight and my brain is indistinguishable from mush.
  • edited August 2019
    Reason for use it:
    1. Don't need different publishing for port 8073 - 8074 - 8075 ... For Internet user it's look like one SDR with standard port but with many channels.
    2. Don't need rules for clients firewall with outgoing port 8073 - 8074 - 8075 ..., yes some configuration need allow external traffic too. Maybe standard 80 port be more for better accessibility.
    3. I can switch off one of KiwiSDR (kiwisdr1 or kiwisdr2) but my site will be available for both DNS name on backup upstream server.
    4. Playing with Nginx config for fun. :smile:
  • OK, fair enough.
Sign In or Register to comment.