账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    nginx的location模块的官方文档的一些部分翻译不通求解
    30
    0

    官方文档地址

    可以用Ctrl+F页内搜索找到原文的位置和上下文

    If a location is defined by a prefix string that ends with the slash character, and requests are processed by one of proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass, memcached_pass, or grpc_pass, then the special processing is performed. In response to a request with URI equal to this string, but without the trailing slash, a permanent redirect with the code 301 will be returned to the requested URI with the slash appended. If this is not desired, an exact match of the URI and location could be defined like this:

    中的

    In response to a request with URI equal to this string, but without the trailing slash, a permanent redirect with the code 301 will be returned to the requested URI with the slash appended.

    这一段到底说了什么?能否举一个例子说明一下?


    after decoding the text encoded in the “%XX” form

    所谓 “%XX” form 是一种什么形式?


    and possible compression of two or more adjacent slashes into a single slash.

    为什么会出现几个'/'相邻的情况?(如果这种情况是错误的话,nginx应该不会说会对它进行处理)


    The “@” prefix defines a named location. Such a location is not used for a regular request processing, but instead used for request redirection. They cannot be nested, and cannot contain nested locations.

    什么叫做不会被用来做正常的请求处理,但会用来请求重定向?也就是说这个location块中不能使用root之类的东西,必须使用proxy_pass之类的?

    另外这个@前缀,前在什么地方?location @ ...吗?


    谢谢

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    • 没事我有雨陪 普通会员 1楼

      Nginx的location模块是一个用于配置路由的模块。它允许您将请求分发到不同的服务器和处理器。如果您想在Nginx中实现一个详细的location块,请参阅官方文档。但是,一些部分的翻译可能存在一些问题。为了更好地理解Nginx的位置模块,请参考以下翻译:

      1. location模块:允许您将请求分发到不同的服务器和处理器。默认情况下,Nginx将请求发送到Web服务器。但是,您可以使用location块来更改这一点。请参阅文档:https://nginx.org/en/docs/http location.html

      2. rewrite模块:允许您重定向用户请求到其他服务器或路由。您还可以在location块中使用rewrite命令,以便更有效地管理URL重写。请参阅文档:https://nginx.org/en/docs/http rewrite_module.html

      3. proxy模块:在Nginx中使用代理服务器可以更有效地管理和分发流量。它允许您将请求发送到其他服务器或路由,以便更好地处理流量。请参阅文档:https://nginx.org/en/docs/http proxy_module.html

      4. location块语法:在location块中,您可以使用各种条件语句,如if、else、and、or等,来控制如何处理请求。请参阅文档:https://nginx.org/en/docs/http location.html

      如果您对Nginx的位置模块有疑问,请随时告诉我,我将尽力为您提供帮助。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部