nginx学习笔记

https server

server {
        listen 端口 ssl http2;
        listen [::]:端口 ssl http2;
        server_name __domain_name__;
        ssl_certificate __cert_dir__/fullchain.cer;
        ssl_certificate_key __cert_dir__/__domain_name__.key;
        location / { 
                root /home/wwwroot/;
        }   
}

alias / root

alias类似于proxy_pass,会自动把跟location match的部分从URI中删掉。而root仍然会保留location里的部分。

文档:http://nginx.org/en/docs/http/ngx_http_core_module.html#alias

参考:

https://stackoverflow.com/questions/11570321/configure-nginx-with-multiple-locations-with-different-root-folders-on-subdomain

https://stackoverflow.com/questions/28130841/removing-start-of-path-from-nginx-proxy-pass

Remove path prefix during proxy_pass

存在的问题

client_max_body_size

文档:https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

stream块好像也会检查body size,但是client_max_body_size只支持http块,不支持stream块。

posted @ 2024-09-28 14:08  寻找繁星  阅读(0)  评论(0编辑  收藏  举报