预览网站在nginx上的virtualmin中不起作用

时间:2015-10-22 14:11:45

标签: wordpress nginx preview virtualmin

我刚刚在nginx上安装了virtualmin(我想在nginx上使用ISPconfig,但我没有成功)。操作系统是Centos 6.4。 由于DNS没有传播,我想通过Virtualmin-> Services->预览网站预览我创建的网站。首先它起作用了,但是在我在/etc/nginx/nginx.conf文件中添加了以下几行之后它就再也没有了。

    fastcgi_hide_header X-Powered-By;

# enforce NO www
if ($host ~* ^www\.(.*))
{
        set $host_without_www $1;
        rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
}

# unless the request is for a valid file, send to bootstrap
if (!-e $request_filename)
{
        rewrite ^(.+)$ /index.php?q=$1 last;
}

上面的代码需要在wordpress网站上制作永久链接。 有什么问题?

1 个答案:

答案 0 :(得分:0)

我不确定,因为我不是专家,但是,根据official documentation

  

Nginx不支持CGI,因此使用CGI的任何应用程序或Virtualmin脚本都不起作用。 Virtualmin应该阻止安装需要CGI,mod_perl或Apache特定功能的脚本。

当我尝试预览网站时,它会重定向到:

https:// MYHOSTNAME:10000 / virtual-server / link.cgi / MYHOSTNAME / http:// website

因此,当我在虚拟机中使用nginx时,它实际上是一个破碎的功能。