Nginx根目录

时间:2016-05-06 19:46:37

标签: apache nginx

我是Nginx的新手,我正在设置它,但有一点我不明白的是根路径。它与Apache有什么不同?

现在我有Apache,我的文件都是/ home / servername / public_html /

所以在Nginx下,根路径是否相同?所有从Apache迁移到Nginx的教程我看到它们显示的默认值如/ user / share / nginx /

提前致谢。

1 个答案:

答案 0 :(得分:0)

是的,它们是一样的。这是您网站的文件位置。

这是非常好的比较:

Apache                                 Nginx
------                                 ------

<VirtualHost *:80>                     server {
                                            listen 80;

ServerName yoursite.com
ServerAlias www.yoursite.com           server_name yoursite.com www.yoursite.com;

DocumentRoot /path/to/root             root /path/to/root;

AllowOverride All                      (No Available Alternative)

DirectoryIndex index.php               index index.php;

ErrorLog /path/to/log                  error_log /path/to/log error;

CustomLog /path/to/log combined        access_log /path/to/log main;

Alias /url/ "/path/to/files"           location /url/ {
<Directory "/path/to/files">                 alias /path/to/files;

DigitalOcean ;)

上找到
相关问题