我有一台正在运行应用程序的服务器 - manictime。我想要重定向嵌套的 URL 以发回图像。
所以现在我尝试删除缩略图来自路径。
/分析/时间线/截图/50699baf-9b4a-4b72-a755-c9b2346a7fc238/1/a5aa2a4c-65d3-4c91-81a9-34cbef22d667/2020-04-02/2020-04-02_19-44-12_03-00_2560_1057_132917。缩略图.jpg
https://regex101.com/r/sM3eS9/4 例如正则表达式如何工作。
但我无法让它在 NginX 中工作。
server {
listen 80;
server_name manictime.tech.fun;
location / {
proxy_pass http://localhost:8666;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ ^/analytics/timelines/screenshot/(.+)/(.+)/(.+)/(.+).thumbnail.jpg {
proxy_pass http://localshot:8666/analytics/timelines/screenshot/$1/$2/$3/$4.jpg;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
- 我做错了什么?
- 我如何调试 nginx 重定向?
先感谢您。