0
location /x/ {
limit_conn x 500;
add_header Access-Control-Allow-Origin *;
allow all;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 2073600;
if ($http_upgrade = websocket) {
proxy_pass http://x;
}
if ($http_upgrade != websocket) {
proxy_pass http://y;
}
}
Hier will ich „websocket“ zu Groß- und Kleinschreibung (ignorieren Fall) .Wie machen kann ich machen? Ich habe einige Dinge selbst ausprobiert. Wie:Wie funktioniert die Bedingung innerhalb eines Standortblocks in nginx conf?
1.
if ($http_upgrade = ~*websocket) {
proxy_pass http://x;
}
if ($http_upgrade != ~*websocket) {
proxy_pass http://y;
}
2.
if ($http_upgrade = "(?i) websocket") {
proxy_pass http://x;
}
if ($http_upgrade != "(?i) websocket") {
proxy_pass http://y;
}
Aber beide Fälle, diese funktionieren nicht.