Home  >  Q&A  >  body text

html - nginx 反向代理 获取三方图片时的referer问题

大家讲道理大家讲道理2742 days ago893

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 13:29:53

    It has nothing to do with nginx. This request is simply your nginx and you have no control over it.

    reply
    0
  • PHPz

    PHPz2017-04-17 13:29:53

    Found some answers.
    1. Because I am not familiar with HTML, I have found out that it is the proxy webpage, which requested images from a third-party website. The website will verify the referer, but can allow the referer to be empty.
    Prohibit the use of referer when requesting, and the problem will be solved.
    Referrer Policy Here you can see the introduction of referrer.
    Well, referrer can be banned, so we can do the simplest thing, ban referrer globally
    2. So here it is

    问题就是在nginx取回的reponse中加一个
    <meta name="referrer" content="no-referrer">

    3. Here
    I saw an article about how-to-add-a-response-header-on-nginx-when-using-proxy-pass,

    4. So now I just use add_header or more_set_header to add a prohibited referrer.
    I am not familiar with HTML, how should I add it?

    reply
    0
  • Cancelreply