I have VirtualBox 4.3.12 with Fedora 20 and nginx 1.4.7 installed. Machine has Bridged Network interface and pings can be done both ways: from host machine (Windows 7) using
ping 192.168.0.15
(virtual machine's ip address)
and from guest machine
ping 192.168.0.10
(host machine ip address)
but what i can't do is access guest machine's nginx from host machine. I have read this and this and have done as those articles / previously asked question told me to, but i still can't manage to view nginx site from host machine.
netstat -tnlp
returns:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 930/nginx: master p
When I did:
iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
I got an error of:
iptables: Index of insertion too big.
The reason is that I do not have any policies in place and so the "INPUT 4" part is trying to insert at index 4 when it should be index = 1. To view your rules do:
sudo iptables --list-rules
Then insert at the appropriate index. (In most cases):
sudo iptables -I INPUT 1 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
This finally got it to work!
My virtualbox settings are:
- host port 8080,
- guest IP 10.0.2.15
- guest port 80
nginx conf file is:
server {
listen 0.0.0.0:80;
location / {
proxy_pass http://localhost:9000;
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments