検証環境
- さくらVPS(CentOS release 6.7)
Nginxのインストール
こちらの記事を参照。
CentOSにnginx最新をyumでインストール
Nginxの起動と自動起動設定
Nginxの設定変更
Nginxの設定ファイルは下記ディレクトリに存在する。
/etc/nginx/
このディレクトリに*.conf
ファイルを配置すると、各サーバの設定が可能である。
example.conf
server {
listen 8080;
server_name dev.example.com;
location / {
root /home/example/dev;
index index.html index.htm index.php;
}
}