我是新手使用nginx,嗯,新的使用任何不是cpanel的东西......当你包含www时,我在使用nginx工作时遇到问题.在网址中.
www.mydomain.com > not work 404
mydomain.com > works
Run Code Online (Sandbox Code Playgroud)
我不确定我是否在命名配置文件或nginx的服务器配置上犯了错误.我有点匆匆学习,如果我在基本配置上犯了一些错误,我不会感到惊讶.我运行最新的nginx和php-fpm,除了我的域名问题,它还可以运行.
我(尝试?)运行子域名,他们工作,但使用www.将导致404.我使用来自我的主.org服务器域的名称服务器等.我将在下面发布所有相关内容,希望有人可以发现我正在制作/或制作的错误.
etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
184.xxx.xxx.146 server.servername.org servername.org
Run Code Online (Sandbox Code Playgroud)
named.conf中
...
view "localhost_resolver" {
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
* If all you want is a caching-only nameserver, then you need only define this view:
*/
# match-clients …Run Code Online (Sandbox Code Playgroud)