将 Apache htaccess 重写条件转换为 nginx
我正在尝试将此 Apache Rewrite 规则移植到 nginx Web 服务器上。
RewriteBase /srv/www/htdocs
RewriteCond %{REQUEST_URI} ^/(files.*)$
RewriteRule ^(.*)$ %1 [L]
我不知道如何在 nginx.conf 中解决这个问题。 有人可以帮忙吗?
谢谢,帕特里斯
I am trying to port this Apache Rewrite rule to be used on a nginx Webserver.
RewriteBase /srv/www/htdocs
RewriteCond %{REQUEST_URI} ^/(files.*)$
RewriteRule ^(.*)$ %1 [L]
I don't know how to resolve this in nginx.conf.
Can anybody help please?
Thanks, Patrice
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个:
来源:http://www.anilcetin.com/convert-apache -htaccess-to-nginx/
Try this:
Source: http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
它可能更简单:
It could be more simple:
感谢您的快速解答!最后,我解决了这个问题,类似于谢尔盖的建议,但嵌套了一个条件。
Thanks for your quick answers! Finally, i solved this problem similar to Sergeis suggestion, but nested with a condition.