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

关于 nginx 的 rewrite 配置。

  •  
  •   Daylight1993 · Mar 15, 2022 · 1544 views
    This topic created in 1548 days ago, the information mentioned may be changed or developed.
    目前图片我们存在 oss ,文件名为 123 这种没有 jpg 后缀。目前访问是 xxx.com/123 需求是访问 xxx.com/123.jpg 也能访问到.这个 rewrite 该怎么写呢。
    wdssmq
        1
    wdssmq  
       Mar 15, 2022
    location / {
    if (!-f $request_filename) {
    rewrite (.+).jpg /$1;
    }
    }

    要么是你实际遇到的问题和我理解的不一样;

    要么。。下边链接有几个二维码这边建议挑一个扫:

    https://github.com/wdssmq#%E4%BA%8C%E7%BB%B4%E7%A0%81
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1028 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:50 · PVG 06:50 · LAX 15:50 · JFK 18:50
    ♥ Do have faith in what you're doing.