Testing a ngix proxy to a transmission server I found that the server was dening the connection. This is strange as the proxy server is only allowed IP address to connect to the transmission server.
I began investigating the rasperry pi and it had to correct ip address.
ifconfig shows that the device has the correct ip address and ngix is reachable from that address.
Next I checked the interfaces file and it also showed the correct configuration
1
cat /etc/network/interfaces
1234567891011
# Please note that this file is written to be used with dhcpcd.# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'.auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.201
gateway 192.168.0.1
netmask 255.255.255.0
1
ip a
1234567891011121314
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:bb:95:b0 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.201/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.0.30/24 brd 192.168.0.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:febb:95b0/64 scope link
valid_lft forever preferred_lft forever
This is very strange it shows that the ethernet interface is gaining a second IP address that I have not set. Doing some web searches I find that the
device has a dhcp deamon that runs automatically and adds this second IP address from my dhcp server.
To resolve the problem I choose to disable the dhcp service on the device.
1
sudo systemctl disable dhcpcd.service
Alternatively I could force the nginx server to only bind to the 192.168.0.201 address however this would mean changing the IP address in multiple places if I ever need to modify the server IP address.