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
相关推荐
LedgerNinja9 小时前
WEEX API 自动化交易实践:下单、撤单、订单查询与状态闭环
运维·自动化
执笔画流年呀9 小时前
Linux搭建Java项目部署环境
java·linux·运维
Dory_Youth10 小时前
联想笔记本电脑失灵
运维·笔记·电脑
W.W.H.10 小时前
嵌入式 Linux外接USB/WIFI模块兼容5G频段实战
linux·运维·5g·wifi
运维大师10 小时前
【K8S 运维实战】24-资源优化HPA与VPA
运维·kubernetes·github
GlobalHRTalk10 小时前
埃及名义雇主EOR业务概述与市场发展优势分析
大数据·运维·人工智能
瞬间&永恒~11 小时前
【MySQL】 主从复制多拓扑搭建实验
运维·数据库·mysql·云原生
Tester Kid11 小时前
Appium 元素定位深度讲解:五种方式逐个拆 + Inspector 完整用法
macos·appium·cocoa
星野爱89512 小时前
远程控制哪家安全性更高?ToDesk、UU远程、向日葵隐私屏深度测评!
linux·运维·网络
ALINX技术博客13 小时前
【黑金云课堂】FPGA技术教程Linux开发:系统定制
linux·运维·fpga开发