Score:0

proxy_pass requests only if the localhost file exists

sz flag
server {
        listen       9991;
        server_name  localhost;

        location / {
            if ( -e http://localhost:8001/assets/plugin-web-layout5/plugin-web-layout5\.js ) {
                rewrite ^/assets/plugin-web-layout5/plugin-web-layout5 http://localhost:8001/assets/plugin-web-layout5/plugin-web-layout5.js;
            }
           
            proxy_pass http://xxxx.cn/web/;
        }


        location /api {
            proxy_pass http://xxxx.cn/api;
        }
    }

How to judge the existence of the local localhost file? Access the local file if it exists.

Score:0
us flag

One can only check existence of files that are available via the local file system. One can not check existence of remote files.

You need to handle the checking on the server that runs at localhost:8001.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.