美文网首页web
【HTTP】Web 开发技术

【HTTP】Web 开发技术

作者: Bogon | 来源:发表于2023-08-29 23:02 被阅读0次

    什么是REST?
    http://restful.p2hp.com
    http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
    http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm

    面向 Web 开发者的文档
    https://developer.mozilla.org/zh-CN/docs/Web

    Set-Cookie
    https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Set-Cookie

    nginx中host、http_host和$proxy_host区别
    https://blog.csdn.net/yihanzhi/article/details/107002881

    HTTP状态204 (No Content)
    http://restful.p2hp.com/resources/http-status-codes/http-status-204-no-content

    解决跨域:

    location ^~ /doc {
                 proxy_pass http://upsdoc;
              }
     
    location ^~ /doc/file/downloadfile {
                 proxy_pass http://upsdoc;
            }
     
    location ^~ /doc/file/uploadfile {
        if ($request_method = "OPTIONS") {
            return 204;
            add_header 'Access-Control-Allow-Origin' '$http_origin';
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'pubacc-buid,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,Accept,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,*';
            add_header 'Access-Control-Max-Age' '3600';
        }
     
        if ($request_method = "GET") {
            add_header 'Access-Control-Allow-Origin' "$http_origin";
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'pubacc-buid,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,Accept,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,*';
        }
     
        if ($request_method = "POST") {
            add_header 'Access-Control-Allow-Origin' "$http_origin";
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'pubacc-buid,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,Accept,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,*';
        }
            proxy_pass http://upsdoc;
    }
    

    相关文章

      网友评论

        本文标题:【HTTP】Web 开发技术

        本文链接:https://www.haomeiwen.com/subject/ceyomdtx.html