Nginx get&post static file returns 200

Nginx get&post static file returns 200

Conventional writing can only return 200 for get requests

       location =/auth/callback {
    
    
               root    /data/nginx/static/test;
               try_files "" /callback.txt;
       }

Both get&post requests return 200

        location =/auth/callback {
    
    
                default_type application/json;
                alias    /data/nginx/static/test/callback.txt;
                error_page 405 =200 http://$host$request_uri;
        }

Reference: https://www.cnblogs.com/suntray/p/9792680.html

Guess you like

Origin blog.csdn.net/lswzw/article/details/107997720