mac nginx 初次配置的默认路径

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yang450712123/article/details/85932597

mac nginx 初次配置的默认路径

问题描述

mac 上初次配置 nginx,会出现找不见默认路径的情况,以下是总结的默认路径

解决方案

nginx 默认安装的地方(默认的配置文件路径)

/usr/local/etc/nginx

nginx 默认配置文件配置的是 8080 端口,会返回一个默认的 index.html 页面,这个 index.html 页面路径为下

// [version] 为 nginx 的版本

/usr/local/Cellar/nginx/[version]/html

如果是用 brew 安装,则: brew info nginx,则可以得到所有信息

brew info nginx
nginx: stable 1.15.8 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/usr/local/Cellar/nginx/1.15.8 (23 files, 1.4MB) *
  Poured from bottle on 2019-01-05 at 20:05:47
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/nginx.rb
==> Dependencies
Required: openssl ✔, pcre ✔
Optional: passenger ✘
==> Options
--with-passenger
	Compile with support for Phusion Passenger module
--HEAD
	Install HEAD version
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

或者是用命令 nginx -V 查看,如下:

nginx -V
nginx version: nginx/1.15.8
built by clang 10.0.0 (clang-1000.11.45.5)
built with OpenSSL 1.0.2q  20 Nov 2018
TLS SNI support enabled
configure arguments: --prefix=/usr/local/Cellar/nginx/1.15.8
--sbin-path=/usr/local/Cellar/nginx/1.15.8/bin/nginx
--with-cc-opt='-I/usr/local/opt/pcre/include -I/usr/local/opt/openssl/include'
--with-ld-opt='-L/usr/local/opt/pcre/lib -L/usr/local/opt/openssl/lib'
--conf-path=/usr/local/etc/nginx/nginx.conf
--pid-path=/usr/local/var/run/nginx.pid
--lock-path=/usr/local/var/run/nginx.lock
--http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp
--http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp
--http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp
--http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp
--http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp
--http-log-path=/usr/local/var/log/nginx/access.log
--error-log-path=/usr/local/var/log/nginx/error.log
--with-debug --with-http_addition_module
--with-http_auth_request_module --with-http_dav_module
--with-http_degradation_module --with-http_flv_module
--with-http_gunzip_module --with-http_gzip_static_module
--with-http_mp4_module --with-http_random_index_module
--with-http_realip_module --with-http_secure_link_module
--with-http_slice_module --with-http_ssl_module
--with-http_stub_status_module --with-http_sub_module
--with-http_v2_module --with-ipv6 --with-mail
--with-mail_ssl_module --with-pcre --with-pcre-jit
--with-stream --with-stream_realip_module
--with-stream_ssl_module --with-stream_ssl_preread_module

猜你喜欢

转载自blog.csdn.net/yang450712123/article/details/85932597
今日推荐