Nginx 套接字 400 错误请求

时间:2021-03-01 15:08:24

标签: nginx nginx-reverse-proxy nginx-location

我需要将 websocket 流量重定向到动态 URL,但我收到 - 400 错误请求

import os

x = int(input("First exercise: "))
y = int(input("Last exercise: "))

    for z in range(x, y):
        i = str(z)
        filenames = [input()]

        for filename in filenames:
            open("python/"+filename+i+".py", "a")

硬编码它工作正常,我做错了什么?

工作示例:

location ~ ^/service/([^/]+)/(.*)$ {
  resolver ...;
  proxy_pass http://$1.localhost:8080/$2;
  ...
}

翻遍了这个问题的所有可能的解决方案,显示了不同的参数,没有结果

最有趣的是,如果你这样指定,它也不起作用:

        location /service/host/ {
          resolver ...;
          rewrite /service/host/(.*)$ /$1 break;
          proxy_pass http://host.localhost:8080/;
          ...
        }

对不起,如果这很简单,我正在学习)我自己无法弄清楚 谢谢!

0 个答案:

没有答案