安装mac osx后安装nginx模块

Fun*_*end 5 macos homebrew nginx

我使用以下命令安装 nginx: brew install nginx

在我的 nginx.conf 文件中使用模块 set_real_ip_from 后:

ginx: [emerg] unknown directive "set_real_ip_froxm" in /usr/local/etc/nginx/nginx.conf:26
Run Code Online (Sandbox Code Playgroud)

我需要安装模块http_realip_module

但我不知道,我试试这个

brew reinstall nginx --with-http_realip_module
Run Code Online (Sandbox Code Playgroud)

但不起作用...

如何安装 nginx 模块?

小智 3

您可以使用 nginx-full。这允许您包含所需的模块。以下是说明:

brew tap homebrew/nginx
brew install nginx-full --with-realip
Run Code Online (Sandbox Code Playgroud)

更多信息请参见https://github.com/denji/homebrew-nginx

  • 虽然此链接可以回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会变得无效。 (2认同)
  • 似乎 homebrew/nginx 已弃用,请使用 denji/nginx 代替 (2认同)