NGINX + memcached,找不到位置

NGINX + memcached,找不到位置

memcached例如,我想將 nginx 配置為直接透過鍵“match_1”讀取。

這是我的server配置

server {
    listen 8080;
    server_name localhost;

    location /get_match {

            set             $memcached_key "match_$arg_match";
            memcached_pass  192.168.3.54:11211;

    }

}

但是,當我嘗試訪問時http://example.com:8080/get_match?match=1我得到一個404 Not Found.

我缺什麼?


編輯

我改為location /get_matchlocation @get_match我不再得到 404,而是一個空白頁。


固定的

我改為location = /get_match.有效。

答案1

我只是location /get_match改為location = /get_match.有效。

但我不明白為什麼。我認為=only 顯示了確切的位置並阻止解析器搜尋給定位置的其他可能的匹配項。任何意見將不勝感激。

相關內容