简体   繁体   中英

nginx '= /' not matching '/'

I have the following server, and it's the only server on my conf

    server {
    listen 8080;
    server_name _;

    location / {
        set $dest http://api_backend;
        set $dest_host 127.0.0.1;
        add_header X-route '= /';

    }

}

The X-route header is just to check if it goes inside, I make a request to http://localhost:8080/ but it's not going inside, however if I remove the = and just leave location / then it does enter. Could anyone help me on why this is happening? I want to match exactly / and not every other route in existence here.

It seems I need to set = /index.html instead of just = / .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM