前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nginx Unit 1.27.0 发布

Nginx Unit 1.27.0 发布

作者头像
小柔
发布2023-10-14 17:17:58
1920
发布2023-10-14 17:17:58
举报
文章被收录于专栏:小柔博客园小柔博客园

介绍

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 的路径和查询部分,完整的例子如下:

代码语言:javascript
复制
{
    "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 指定索引来使用不同的默认文件名。下面提供了一个完整的例子:

代码语言:javascript
复制
"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 文件名。

完整的更新日志

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

代码语言:javascript
复制
*) 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…

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2023-10-11,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 介绍
  • 更新内容
    • 将 HTTP 请求重定向到 HTTPS
      • 为纯路径 URI 提供可配置的文件名
        • 完整的更新日志
          • 其他
            • 平台更新
            相关产品与服务
            服务网格
            服务网格(Tencent Cloud Mesh, TCM),一致、可靠、透明的云原生应用通信网络管控基础平台。全面兼容 Istio,集成腾讯云基础设施,提供全托管服务化的支撑能力保障网格生命周期管理。IaaS 组网与监控组件开箱即用,跨集群、异构应用一致发现管理加速云原生迁移。
            领券
            问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档