V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
marionette0x01
V2EX  ›  NGINX

Nginx 反代 GG

  •  
  •   marionette0x01 · Jan 10, 2016 · 3051 views
    This topic created in 3762 days ago, the information mentioned may be changed or developed.

    请不要在意标题里的 GG 是什么意思。。缩写而已。写全了就是某谷而已。
    我在网上找到的很多教程都是在一个新的二级域名下直接反代。但因为某些特殊原因没法这么做。所以必须把路径搞成这样子的 https://SomeRandomDomain.com/google 在按照网上的设置方法设置完成后访问。服务器返回了一个 GG 的 404 Page 。告诉我 我请求的 /google/在服务器上不存在。。那我具体该怎么做。

    nbndco
        1
    nbndco  
       Jan 10, 2016
    在 location 下面设置
    nbndco
        2
    nbndco  
       Jan 10, 2016
    想了一下,还是很难,你还要重写网页里所有的链接才行
    tony1016
        3
    tony1016  
       Jan 10, 2016
    嗯,谷歌的资源是用根路径获取的,比如<link href="/images/branding/product/ico/googleg_lodp.ico" rel="shortcut icon">,会跳过设置好的 /google 。除非你把他的资源都拉出来做反向代理。看了看,资源也不多,确实可以做到
    tony1016
        4
    tony1016  
       Jan 10, 2016
    有需要,用用我主页上自己做的吧, tonylee.name ,不直接公布地址了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4980 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 01:09 · PVG 09:09 · LAX 18:09 · JFK 21:09
    ♥ Do have faith in what you're doing.