facebook twitter hatena line email

Mac/インストール/nginx

提供: 初心者エンジニアの簡易メモ
移動: 案内検索

インストール

brew install nginx

起動・停止・再起動

sudo nginx #起動
sudo nginx -s stop # 停止
sudo nginx -s reload # 再起動

httpアクセス

ttp://localhost:80/

設定ファイルのドキュメントルート変更

vi /usr/local/etc/nginx/nginx.conf
       location / {
           root   html;

参考

http://phiary.me/mac-nginx-install/

自動起動

ln -s /usr/local/opt/nginx/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

自動起動確認

brew services list

設定ファイルの追加

vi servers/default.conf

以下参照

linux/nginx [ショートカット]