Nginx get&post 静态文件返回200

Nginx get&post 静态文件返回200

常规写法 只能get请求返回200

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

get&post请求都返回200

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

参考:https://www.cnblogs.com/suntray/p/9792680.html

猜你喜欢

转载自blog.csdn.net/lswzw/article/details/107997720