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";
                }
        }
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章