Nginx 是一个高性能的 HTTP 和反向代理服务器,它提供了诸如 IMAP、POP3 和 SMTP 等邮件代理服务。以下是 Nginx 的主要作用:12345
此外,Nginx 还支持其他功能和配置,如 SSL 证书代理、防盗链、解决跨域问题等。
- # 安装nginx
- brew install nginx
- # 查看nginx信息(后续着重讲解)
- brew info nginx
- # 启动
- brew services start nginx
- # 修改配置后重启
- brew services restart nginx
- # 停止
- brew services stop nginx
- # 查看nginx是否启动,存在nginx:master即是启动中的nginx进程号
- ps -ef|grep nginx
- # 1. ngxin 版本号及用途
- ==> nginx: stable 1.23.3 (bottled), HEAD
- HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
- https://nginx.org/
- /opt/homebrew/Cellar/nginx/1.23.3 (26 files, 2.2MB) *
- Poured from bottle using the formulae.brew.sh API on 2023-02-20 at 21:55:38
- # 2. 下载nginx路径
- From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/nginx.rb
- License: BSD-2-Clause
- ==> Dependencies
- Required: openssl@1.1 ✔, pcre2 ✔
- ==> Options
- --HEAD
- Install HEAD version
- ==> Caveats
- # 3. nginx默认写好的html存放路径
- Docroot is: /opt/homebrew/var/www
- # 4. nginx.conf 配置文件路径
- The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that
- nginx can run without sudo.
- # 5. nginx会将该路径下的所有文件配置一同加载
- nginx will load all files in /opt/homebrew/etc/nginx/servers/.
-
- To start nginx now and restart at login:
- brew services start nginx
- ==> Analytics
- install: 39,717 (30 days), 119,551 (90 days), 465,618 (365 days)
- install-on-request: 39,672 (30 days), 119,390 (90 days), 464,831 (365 days)
- build-error: 11 (30 days)
局域网设备对vue项目的访问
ifconfig | grep "inet"