macOS brew 安装的nginx 文件在哪里?

很早之前我用brew安装了一个nginx,并部署了一个静态的index.html。今天我在找这个index.html文件时发现找不到了。

首先我的通过

bash 复制代码
nginx -t
nginx: the configuration file /opt/homebrew/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /opt/homebrew/etc/nginx/nginx.conf test is successful

这里能看出来nginx的配置文件路径

我这里核心配置如下:

bash 复制代码
    server {
        listen       8001;
        server_name  localhost;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }
   }

配置是安装后自带的,我应该只是修改了端口。

看到root html; 我就懵了一下,这个路径在哪?

bash 复制代码
nginx -V 2>&1 | grep prefix

可以通过以上命令查询,我这里有一行这样的输出

configure arguments: --prefix=/opt/homebrew/Cellar/nginx/1.29.8

最终我找到了我的html最终路径

bash 复制代码
/opt/homebrew/Cellar/nginx/1.29.8/html

这个路径还是一个软链接,最原始的路径应该是:

bash 复制代码
/opt/homebrew/var/www
相关推荐
三言老师15 小时前
K8s集群运行时自动化运维全覆盖落地实操(下)
linux·运维·服务器·网络
躺不平的理查德17 小时前
嵌入式 Linux 系统移植与 SD 卡量产镜像制作
linux·运维·服务器
一直走下去-明18 小时前
centos7无法安装tcpreplay
linux·运维
IT大白鼠18 小时前
n8n工作流自动化平台技术架构与应用价值评估
运维·架构·自动化·n8n
anxiao_m19 小时前
园区数字孪生怎么搭建?主流方案与服务商深度对比
大数据·运维·人工智能
时空无限19 小时前
ubuntu dpkg -l 输出第一列解释
linux·运维·ubuntu
Splashtop高性能远程控制软件19 小时前
AI 落地的连接基建评估:消费品行业远程连接方案的四个技术维度(性能 / 精度 / 安全 / 统一管理)
运维·人工智能·安全·远程工作·splashtop
ITyunwei098720 小时前
技术管理者视角:AI 重构 ITSM 的四个工程化落点
运维·人工智能
666_qq_403882331 天前
Tabstack 浏览器自动化实战应用指南
运维·自动化
fatcoder1 天前
玩转Nginx 04 — 反向代理:给 nginx 接上后端
前端·后端·nginx