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

nginx rewrite 规则该如何写?

  •  
  •   soho176 · Mar 29, 2013 · 3385 views
    This topic created in 4794 days ago, the information mentioned may be changed or developed.
    A图片地址 /160/timg02/T1xLrQXktiXXa.A0w9_102758.jpg
    160 这个是随机的三位数字
    B图片地址 /i2/T1xLrQXktiXXa.A0w9_102758.jpg_160x160.jpg

    A 图 中的 2 对应B图中的2 ,A图的图片地址对应B图的地址加上_160x160.jpg,

    想让A图的地址重定向到B图的地址,写了几个规则结果都是不行,懂的帮忙看看怎么写,谢谢了。
    2 replies    1970-01-01 08:00:00 +08:00
    kisspy
        1
    kisspy  
       Mar 29, 2013   ❤️ 1
    ^/([0-9]+)/timg0([0-9]+)/(.*\.jpg)$ /i$2/$3_$1x$1.jpg [L]
    试试
    soho176
        2
    soho176  
    OP
       Mar 29, 2013
    @kisspy 测试了不行 还是谢谢了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4059 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 05:08 · PVG 13:08 · LAX 22:08 · JFK 01:08
    ♥ Do have faith in what you're doing.