小编Jet*_*tam的帖子

NGINX 添加两个变量/参数编号

我正在尝试设置一个 Nginx,我想在其中将两个数字相加。

server {
        server_name "~^pr-(\d*).review-apps.example.com$";
        
        location / {
            set $port 50000+$1;
            proxy_pass "http://localhost:$port/test";
        }
    } 
Run Code Online (Sandbox Code Playgroud)

但这是行不通的。(结果为字符串形式。例如“50000+125”)

如何在 nginx.conf 中添加两个数字?有可能吗?

nginx nginx-reverse-proxy

5
推荐指数
1
解决办法
1304
查看次数

标签 统计

nginx ×1

nginx-reverse-proxy ×1