Nginx Unit 1.27.0 发布

目录

介绍

更新内容

将 HTTP 请求重定向到 HTTPS

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

完整的更新日志

其他

平台更新


介绍

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

更多资讯请查看该链接:unit.nginx.org/news/2022/u…

原文链接:Nginx Unit 1.27.0 发布 - 掘金 (juejin.cn)

  • 11
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

魏铁锤爱摸鱼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值