我以前使用过Apache,所以我知道默认的公共web根目录通常是/var/www/。
我最近开始使用nginx,但我似乎找不到默认的公共web根。
我在哪里可以找到nginx的默认公共web根?
我以前使用过Apache,所以我知道默认的公共web根目录通常是/var/www/。
我最近开始使用nginx,但我似乎找不到默认的公共web根。
我在哪里可以找到nginx的默认公共web根?
当前回答
对于AWS EC2 Linux,您将在这里找到:
/usr/share/nginx
其他回答
Debian上Nginx的默认目录是/var/www/nginx-default。
可以查看“/etc/nginx/sites-enabled/default”文件
并找到
server {
listen 80 default;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
location / {
root /var/www/nginx-default;
index index.html index.htm;
}
根节点是默认位置。
在Mac上使用brew安装nginx:
/ usr / local / etc / nginx / nginx上。
location / {
root html; # **means /usr/local/Cellar/nginx/1.8.0/html and it soft linked to /usr/local/var/www**
index index.html;
}
对于CentOS、Ubuntu和Fedora,默认目录为/usr/share/nginx/html
对于nginx/1.4.6 (Ubuntu)
/etc/nginx$ cat /etc/nginx/sites-available/default | grep -i root
- root /usr/share/nginx/html;
如果在Ubuntu上使用apt-get安装,请尝试/usr/share/nginx/www.
编辑:
在最近的版本中,路径已更改为: /usr/share/nginx/html
2019编辑:
你也可以试试/var/www/html/index.nginx-debian.html。