简体   繁体   English

Nginx重写到服务器上的另一个路径

[英]Nginx Rewrite to another path on the server

Is it possible to do a rewrite rule in nginx to rewrite to another location on the server, outside of the current account? 是否可以在nginx中执行重写规则以重写到服务器上当前帐户之外的其他位置?

For example, I want to rewrite image123.jpg to location on the server /dev/shm/123.jpg . 例如,我想将image123.jpg重写到服务器/dev/shm/123.jpg上的位置。 Is this possible? 这可能吗?

I could grab the image with a PHP script and rewrite to that, but I'd rather it was done more efficiently. 我可以使用PHP脚本抓取图像并将其重写,但是我宁愿更高效地完成它。

是的,这是可能的:看看别名 -directive

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM