iyaozhen
V2EX  ›  问与答

如何根据域名转发请求

  •  
  •   iyaozhen · Sep 14, 2015 · 2821 views
    This topic created in 3898 days ago, the information mentioned may be changed or developed.
    目前有这样一个需求:
    想在服务器( ubuntu server )再部署一套环境运行环境( Nginx+PHP7 为了性能),但现在已经运行的有 Apache+PHP 了(监听了 80 端口)。

    用户访问 bbb.example.com/* 的时候请求落在新的环境上。新环境的 Nginx 监听 8090 端口。

    这个怎么弄?目前的想法是 Apache 做转发(反代),但这多了一步,感觉新环境提升的性能会在这里损失掉。
    3 replies    2015-09-14 19:23:11 +08:00
    alect
        1
    alect  
       Sep 14, 2015
    难道不应该是 nginx 做前端作为主要环境, Apache 改端口?
    iyaozhen
        2
    iyaozhen  
    OP
       Sep 14, 2015
    @alect 唉,历史遗漏问题。 Apache 那一套不敢动,代码不是很熟,版本也比较老了,升级有风险。
    iyaozhen
        3
    iyaozhen  
    OP
       Sep 14, 2015
    @alect 哦,对。 Nginx 转发到 Apache , Nginx 监听 80 端口,把以前的项目都用转发到 Apache (比如 8090 端口)上面。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1064 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 17:59 · PVG 01:59 · LAX 10:59 · JFK 13:59
    ♥ Do have faith in what you're doing.