4

brew 安装的 nginx 怎么绑定到 127.0.0.1 的 80 端口

 1 year ago
source link: https://www.v2ex.com/t/862856
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  macOS

brew 安装的 nginx 怎么绑定到 127.0.0.1 的 80 端口

  scp173 · 2 小时 32 分钟前 · 420 次点击

我需要启动(使用 brew 安装的) nginx 的 80 端口,但是不希望被局域网访问,系统是 macOS Monterey 12.4

这种配置可以启动

    server {
        listen       0.0.0.0:80;
        ...
    }

这种配置就不行

    server {
        listen       127.0.0.1:80;
        ...
    }
bind() to 127.0.0.1:80 failed (13: Permission denied)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK