LoginSignup
50
43

More than 5 years have passed since last update.

nginx 公開ディレクトリの変更

Last updated at Posted at 2018-03-25

nginxの設定ファイルはここ。

/etc/nginx/nginx.conf

公開ディレクトリがデフォルトでは/usr/share/nginx/htmlになっている。
/var/www/htmlに変更する。

$ sudo vim /etc/nginx/nginx.conf

serverコンテキストのlocationディレクティブに設定を追加する。

server {
    location / {
        root /var/www/html
    }
}

nginxを再起動する。

$ systemctl restart nginx
50
43
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
50
43