zoukankan      html  css  js  c++  java
  • 写一个nginx.conf方便用于下载某个网页的所有资源

    写一个nginx.conf方便用于下载某个网页的所有资源

    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
    
        server{
            listen 8811;
            listen [::]:8811;
            set $proxy_pass_schema "https";
            set $proxy_pass_host "这里改成你要下载网站的域名";
            set $proxy_pass "${proxy_pass_schema}://${proxy_pass_host}";
            resolver 114.114.114.114;
            index _index.html;
            set $rootDir "hosts/${proxy_pass_host}";
            root "${rootDir}";
            proxy_set_header Host $proxy_pass_host;
            proxy_set_header Accept-Encoding "";
            location /{
                set $tmpfile "${rootDir}${uri}";
                proxy_store $tmpfile;
                if (!-e $request_filename) {
                    proxy_pass $proxy_pass;
                }
            }
            location ~ /$ {
                set $tmpfile "${rootDir}${uri}_index.html";
                proxy_store $tmpfile;
                if (!-e $tmpfile) {
                    proxy_pass $proxy_pass;
                }
            }
        }
    
    }
  • 相关阅读:
    RQNOJ 1 明明的随机数
    poj1284
    poj1061
    51nod1305
    51nod 1344
    poj2240
    poj1860
    使用SwitchToThisWindow时不切换问题
    c#拷贝整个文件夹到指定文件夹下(非递归)
    IniHelper
  • 原文地址:https://www.cnblogs.com/xiangxisheng/p/14071746.html
Copyright © 2011-2022 走看看