› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
yuedingwangji
V2EX  ›  NGINX

请教一个 nginx 修改返回状态码的问题

  •  
  •   yuedingwangji · Nov 11, 2017 · 5127 views
    This topic created in 3291 days ago, the information mentioned may be changed or developed.

    RT, 比如我在要在用户访问某个图片 rul 的时候, 将原来返回的 200 状态码 修改为 502,请问该怎么做? 可能说得不明确 , 我的想法是利用 location 让用户访问这个 url 的时候, 返回我自己定义的状态码

    3 replies  •  2017-11-12 21:23:58 +08:00
    okletswin
    okletswin
    Nov 11, 2017
    1
    location /xxx {
    return 502
    }

    凭印象写的,顺着思路查一查吧
    daggerjames
    daggerjames
    Nov 11, 2017
    2
    看上去像是一个防盗链的需求。。。 [随手一搜]( http://itindex.net/detail/54493-%E5%AE%8C%E7%BE%8E-nginx-%E5%9B%BE%E7%89%87)
    huayun
    huayun
    Nov 12, 2017
    3
    http://blog.csdn.net/my_one_piece/article/details/77161992
    可以参考下这个,不过能详细的说说需求最好了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2047 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:54 · PVG 22:54 · LAX 06:54 · JFK 09:54
    ♥ Do have faith in what you're doing.