After installing the Nginx server under Linux in the virtual machine, the machine can obtain the web content through curl, but it cannot be accessed on the host machine and the following error occurs:
In this case, it is usually Linux The system's firewall rules need to be configured to open the network ports you need to access. The settings are as follows:
Open the file /etc/sysconfig/iptables for editing, and add 12 lines under the default port 22 of ssh for nginx For the server, 13 more lines of port 3306 are added here for remote access to mysql. After configuration, just restart the firewall.
service iptables restartTry again on the host:
ConfigurationSuccessful!
The above introduces how to handle the situation when the host cannot be accessed after installing Nginx in Linux under the virtual machine, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.