51
44

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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
51
44
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
51
44

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?