【问题标题】:Preview website doesn't work in virtualmin on nginx预览网站在 nginx 上的 virtualmin 中不起作用
【发布时间】:2016-01-21 20:33:27
【问题描述】:

我刚刚在 nginx 上安装了 virtualmin(我想在 nginx 上安装 ISPconfig,但我没有成功)。操作系统是 Centos 6.4。 由于 DNS 没有传播,我想通过 Virtualmin->Services->Preview Website 预览我创建的网站。首先它起作用了,但是在我在 /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 网站上制作工作永久链接所需要的。 怎么了?

【问题讨论】:

    标签: wordpress nginx preview virtualmin


    【解决方案1】:

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

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

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

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

    所以我猜,在 virtualmin 中使用 nginx 时,它实际上是一个损坏的功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-22
      • 1970-01-01
      • 1970-01-01
      • 2021-10-29
      • 1970-01-01
      相关资源
      最近更新 更多