AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 398490
Accepted
George Reith
George Reith
Asked: 2012-06-14 13:33:52 +0800 CST2012-06-14 13:33:52 +0800 CST 2012-06-14 13:33:52 +0800 CST

非标准端口上的 Nginx 虚拟主机无法正常工作

  • 772

我正在尝试使用清漆作为 Nginx 的前端代理。

当我尝试使用以下内容作为我的虚拟主机配置时:

server {
  listen 8080;
  server_name playwithbits.com  www.playwithbits.com;

  # limit_conn limit_per_ip 16;
  # ssi  on;

  access_log /home/nginx/domains/playwithbits/log/access.log combined buffer=32k;
  error_log /home/nginx/domains/playwithbits/log/error.log;

  root /home/nginx/domains/playwithbits/public;

  location / {

  # Enables directory listings when index file not found
  #autoindex  on;

  # Shows file listing times as local time
  #autoindex_localtime on;

  # Enable for vBulletin usage WITHOUT vbSEO installed
  #try_files             / /index.php;

  }

  include /usr/local/nginx/conf/staticfiles.conf;
  include /usr/local/nginx/conf/php.conf;
  include /usr/local/nginx/conf/drop.conf;
  #include /usr/local/nginx/conf/errorpage.conf;
}

但是,当我指定listen 8080并重定向到默认的 nginx web 根目录(如 中指定的virtual.conf)时,这将停止工作,如果我删除该行,它将按预期工作并重定向到正确的目录。

有谁知道为什么会这样,以及我如何为我的虚拟主机设置一个非标准端口,以便清漆可以在端口 80 上侦听。

linux centos nginx varnish
  • 1 1 个回答
  • 660 Views

1 个回答

  • Voted
  1. Best Answer
    George Reith
    2012-06-15T00:16:24+08:002012-06-15T00:16:24+08:00

    问题不是 Nginx,而是 Wordpress。显然 WordPress 会自行重定向,您必须将端口扩展放在WordPress Address (URL)仪表板的设置中,如下所示:

    http://playwithbits.com:8080

    它有效,否则 WordPress 会重定向到端口 80,导致我的默认 Nginx 配置启动。

    • 0

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 你最喜欢的 Linux 发行版是什么?[关闭]

  • 更改 PHP 的默认配置设置?

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve