nginx代理静态目录

代理html目录:

server {
        listen  80;
        server_name 0.0.0.0;
        
        location / {
                root /home/dist;
                index index.html;
        }
    }

代理静态文件目录:

server {
        listen  90;
        server_name 0.0.0.0;
        
        location /file/ {
                alias /home/dist;
                if ($arg_docName ~* \.*$) {
                        add_header Content-Disposition "attachment;filename=$arg_docName";
                }
        }
    }

猜你喜欢

转载自blog.csdn.net/xqnode/article/details/94383025
今日推荐