page contents

Nginx Unit 1.27.0 发布

Nginx Unit 是一个动态应用服务器,能够与 Nginx Plus 和 Nginx 开源版并行或独立运行。

attachments-2022-06-hbNSGN7Z62a2a24744008.png

Nginx Unit 是一个动态应用服务器,能够与 Nginx Plus 和 Nginx 开源版并行或独立运行。Nginx Unit 支持 RESTful JSON API,可以在不中断服务的情况下更改配置,并可运行基于多种语言和架构的应用。Nginx Unit 生来就是为满足分布式应用的需求而设计的,可为您的服务网格奠定坚实的基础。

更新内容

Nginx Unit 1.27.0 正式发布,更新内容如下:

将 HTTP 请求重定向到 HTTPS

自从在 Unit 中加入了 TLS 支持和证书管理,就被要求简化将纯文本 HTTP 请求重定向到启用 TLS 的监听器。现在可以通过配置路由 action 的 location 值来实现这一功能。事实上,现在有一个新的变量, $request_uri,它包含了原始 URI 的路径和查询部分,完整的例子如下:

{
    "listeners": {
        "*:443": {
            "tls": {
                "certificate": "example.com"
            },
            "pass": "routes"
        },
        "*:80": {
            "pass": "routes"
        }
     },

    "routes": [
        {
            "match": {
                "scheme": "http"
            },
            "action": {
                "return": 301,
                "location": "<https://$>{host}${request_uri}"
            }
        }
}

这种配置使 Unit 能够监听纯文本和启用 TLS 的端口,确保在纯文本端口收到的任何请求都会通知浏览器在启用 TLS 的端口重新提交。

为纯路径 URI 提供可配置的文件名

现在你可以通过为路由 action 指定索引来使用不同的默认文件名。下面提供了一个完整的例子:

"routes": [
    {
        "match": {
            "uri": "/cms/*"
        },
        "action": {
            "share": "/var/cms$uri",
            "index": "default.html"
        }
    },
    {
        "action": {
            "share": "/var/www$uri"
        }
    }
]

这个配置使 Unit 能够为指向 /cms/* 的纯路径 URI 提供 default.html,为所有其他纯路径的 URI 提供默认的 index.html 文件名。

完整的更新日志

这个版本还包括许多错误修复。完整的更新日志可以在下面看到。

*) Feature: ability to specify a custom index file name when serving
   static files.

*) Feature: variables support in the "location" option of the "return"
   action.

*) Feature: support empty strings in the "location" option of the
   "return" action.

*) Feature: added a new variable, $request_uri, that includes both the
   path and the query parts as per RFC 3986, sections 3-4.

*) Feature: Ruby Rack environment parameter "SCRIPT_NAME" support.

*) Feature: compatibility with GCC 12.

*) Bugfix: Ruby Sinatra applications don't work without custom logging.

*) Bugfix: the controller process could crash when a chain of more than
   four certificates was uploaded.

*) Bugfix: some Perl applications failed to process the request body,
   notably with Plack.

*) Bugfix: some Spring Boot applications failed to start, notably with
   Grails.

*) Bugfix: incorrect Python protocol auto detection (ASGI or WSGI) for
   native callable object, notably with Falcon.

*) Bugfix: ECMAScript modules did not work with the recent Node.js
   versions.

其他

  • 与 GCC 12 兼容
  • 错误修正:一些 Spring Boot 应用程序无法启动
  • 错误修正:Python 协议的自动检测不正确
  • 错误修正:ECMAScript 模块不能与最近的 Node.js 版本一起使用

平台更新

官方软件包现在可用于以下 Linux 发行版:

  • Fedora 36
  • RHEL 9
  • Ubuntu 22.04

Docker 镜像已经更新,以使用最新的语言版本:

  • Go 1.18
  • PHP 8.1
  • Ruby 3.1

更多相关技术内容咨询欢迎前往并持续关注六星社区了解详情。

想高效系统的学习Python编程语言,推荐大家关注一个公众号:Python编程学习圈。每天分享行业资讯、技术干货供大家阅读,关注即可免费领取整套Python入门到进阶的学习资料以及教程,感兴趣的小伙伴赶紧行动起来吧。

attachments-2022-05-rLS4AIF8628ee5f3b7e12.jpg

  • 发表于 2022-06-10 09:45
  • 阅读 ( 301 )
  • 分类:行业资讯

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
轩辕小不懂
轩辕小不懂

2403 篇文章

作家榜 »

  1. 轩辕小不懂 2403 文章
  2. 小柒 1316 文章
  3. Pack 1135 文章
  4. Nen 576 文章
  5. 王昭君 209 文章
  6. 文双 71 文章
  7. 小威 64 文章
  8. Cara 36 文章