nginx環境安裝配置 MAC

2021-09-10 12:00:22 字數 1794 閱讀 7715

// 搜尋軟體

brew search nginx

// 安裝軟體

brew install nginx

// 查詢軟體資訊

brew info nginx

// 檔案所在位址

cd /usr/local/etc/nginx

// 檢視配置檔案

}

location /
// 啟動服務

sudo nginx

// 測試nginx服務狀態

nginx -t

//修改配置後重載入

nginx -s reload

//在/library/launchdaemons下新建乙個com.nginx.plist檔案

cd /library/launchdaemons

sudo vim com.nginx.plist

<?xml version="1.0" encoding="utf-8"?>

label

nginx

program

/usr/local/nginx/sbin/nginx

keepalive

networkstate

launchonlyonce

// 重載入

launchctl load /library/launchdaemons/com.nginx.plist

server 

location /api

}

mac 安裝配置 nginx

mac 1024 以下的埠為特權埠,只有 root 使用者才有權監聽。因此,要在 mac 上使用 web 服務軟體監聽 80 或 443 埠,要麼以 root 使用者啟動應用程式,要麼使用埠 但是專案常用到443和80這兩個低端口,使用nginx反向 使用低端口。錯誤情況 如果之前沒安裝過homeb...

mac上安裝配置啟動nginx

1.安裝 第一步,安裝brew 如果已安裝,過!在命令列終端執行 ruby e curl fssl 第二步,安裝nginx.在命令列終端執行 usr local bin brew install nginx 2.配置 配置檔案目錄 usr local etc nginx nginx.conf 使用v...

nginx環境下 XCache安裝配置

二 安裝模組 tar zxvf xcache 1.2.2.tar.gz cd xcache 1.2.2 usr local php bin phpize configure with php config usr local php bin php config enable xcache enab...