Home  >  Q&A  >  body text

macos - The LAN cannot access the nginx server due to the firewall being turned on under mac

As the title states, I am on the os x10.10 platform, and the locally configured server environment is nginx php mysql. Local access to localhost and related functions are all normal, but they cannot be accessed on other computers in the LAN, so they cannot be demonstrated to others.

Then I found that if I turned off the firewall on the mac, I could access it normally. So the question is: How can other computers on the LAN still access my server for demonstrations while keeping the firewall on? I didn't find out where I can set anything in the firewall options, and I don't know much about the command line. ~-~

First, thank you!

曾经蜡笔没有小新曾经蜡笔没有小新2712 days ago1970

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-16 17:27:30

    Your problem is very similar to the one I encountered before

    I refer to this article http://ju.outofmemory.cn/entry/154709 and finally realized that other computers can remotely modify and access the local webserver when the firewall is turned on

    The main thing is to set nginx to be owned by root, then close nginx and then open it as root sudo nginx

    However, my situation here is a bit special. After modifying the nginx permissions, I cannot access it immediately with the firewall turned on. It needs to be restarted.

    I don’t know the specific situation. If you encounter a similar situation, you can try to restart after configuring the permissions

    reply
    0
  • Cancelreply