NGinx默认的公共www位置? [英] NGinx Default public www location?

查看:55
本文介绍了NGinx默认的公共www位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前使用过Apache,所以我知道默认的公共Web根目录通常是/var/www/.

I have worked with Apache before, so I am aware that the default public web root is typically /var/www/.

我最近开始使用nginx,但似乎找不到默认的公共Web根.

I recently started working with nginx, but I can't seem to find the default public web root.

在哪里可以找到nginx的默认公共Web根目录?

Where can I find the default public web root for nginx?

推荐答案

如果您的配置不包含root /some/absolute/path;语句,或者它包含使用诸如root some/relative/path;之类的相对路径的语句,则生成的路径取决于编译时间选项.

If your configuration does not include a root /some/absolute/path; statement, or it includes one that uses a relative path like root some/relative/path;, then the resulting path depends on compile-time options.

如果您"noreferrer" title ="www.nginx.org">并自己编译了源代码.在这种情况下,路径将相对于所使用的任何--prefix.如果未更改,则默认为/usr/local/nginx.您可以通过nginx -V找到使用nginx编译的参数,它将--prefix列为第一个参数.

Probably the only case that would allow you to make an educated guess as to what this means for you would be, if you downloaded and compiled the source yourself. In that case, the paths would be relative to whatever --prefix was used. If you didn't change it, it defaults to /usr/local/nginx. You can find the parameters nginx was compiled with via nginx -V, it lists --prefix as the first one.

由于> root指令默认为 ,这当然会导致/usr/local/nginx/html是您问题的答案.

Since the root directive defaults to html, this would, of course, result in /usr/local/nginx/html being the answer to your question.

但是,如果您以其他任何方式安装了nginx,则所有选择都将关闭.您的发行版可能使用完全不同的默认路径.学会弄清楚您的选择分配用于事物的默认类型是完全另一项任务.

However, if you installed nginx in any other way, all bets are off. Your distribution might use entirely different default paths. Learning to figure out what kind of defaults your distribution of choice uses for things is another task entirely.

这篇关于NGinx默认的公共www位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆