写一个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;
}
}
} }

写一个nginx.conf方便用于下载某个网页的所有资源的更多相关文章

  1. 用Python+Aria2写一个自动选择最优下载方式的E站爬虫

    前言 E站爬虫在网上已经有很多了,但多数都只能以图片为单位下载,且偶尔会遇到图片加载失败的情况:熟悉E站的朋友们应该知道,E站许多资源都是有提供BT种子的,而且通常打包的是比默认看图模式更高清的文件: ...

  2. 配置php环境的一个nginx.conf

    文件:nginx.conf 内容: #user  nobody;worker_processes  1; #error_log  logs/error.log;#error_log  logs/err ...

  3. 给大家推荐一个nginx.conf文件格式生成的网站

    特别好用: 根据选择自定义nginx.conf的配置: https://nginxconfig.io/?0.php=false&0.python&php_server=%2Fvar%2 ...

  4. 写一个nginx监控日志

    下面的代码是实现一个nginx监控日志功能,是不是很好玩呢.

  5. 写一个基于NSURLSession的网络下载库

    前段时间AFNetworking 更新到3.0 ,彻底废弃NSURLConnection的API转由NSURLSession来实现,代码并没有改动很大,AF封装的很好了,读完源码感觉收获很大. 下载不 ...

  6. Nginx 配置日志路径(nginx.conf没有写log路径,所以debug的时候找不到日志)

    缘由:nginx.conf没有写log路径,所以debug的时候找不到日志,遂在conf文件里写入了log路径 Setp1.nginx默认日志路径: /var/log/nginx Setp2.conf ...

  7. 从docker到docker-compose部署一个nginx+flask+mysql+redis应用

    目的是把一个flask项目的mysql数据库.redis数据库.flask应用.nginx服务分别装到四个容器中,然后用docker-compose命令同时启动与关闭 一.安装docker Docke ...

  8. nginx系列 3 nginx.conf介绍(1)

    一. nginx.conf 文件结构概述 在第一篇中讲到nginx的安装,安装完后,默认的nginx服务器配置文件都存在安装目录conf中,主配置文件名为nginx.conf.下面是我linux系统安 ...

  9. nginx配置文件nginx.conf 不包括server节点

    整理的一个nginx.conf的配置,不包括server节点介绍 原文请查看,Nginx配置文件(nginx.conf)配置详解 # For more information on configura ...

随机推荐

  1. Codeforces Round #661 (Div. 3) D、E1 题解

    D. Binary String To Subsequences #贪心 #构造 题目链接 题意 给定一个\(01\)串\(s\),完全分割成若干子序列(注意,不要混淆子串与子序列的概念),其中的子序 ...

  2. JDk8的新特性-流和内部iteration

    JDK8到今天已经出了好几年了  但是在公司能用到新特性的地方还是很少, 去年的时候当时项目老大要求我们用最新的写法来写Java 刚开始看到用stream写出来的代码一脸懵逼,内心就在想  这是Jav ...

  3. LeetCode 018 4Sum

    题目描述:4Sum Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c ...

  4. GoLang 自学系列(二)—— defer

    defer 关键字 首先来看官网的定义: A "defer" statement invokes a function whose execution is deferred to ...

  5. 笔记本无法连接校园网,windows诊断显示校园网之未响应

    打开cmd(管理员): 输入以下四条,每一条都按enter ipconfig /flushdns ipconfig /registerdns ipconfig /release ipconfig / ...

  6. NOIP 2020 退役记

    躲进你的身体. 哈哈 没想到这么快就轮到我退役啦 以前想想还感觉挺遥远的 这是我最后的机会啦! day-1 晚上照例吃了断头饭 但是没有蛋糕/kk 恭喜 Luckyblock 逃过一劫! (照照片的时 ...

  7. DRF的限流配置

    在settings.py中添加配置 REST_FRAMEWORK = { #3.限流(防爬虫) 'DEFAULT_THROTTLE_CLASSES': [ 'rest_framework.thrott ...

  8. 老猿学5G:3GPP 5G规范中的URI资源概念

    ☞ ░ 前往老猿Python博文目录 ░ 说明: 本文参考3GPP29.501<Principles and Guidelines for Services Definition>结合笔者 ...

  9. PyQt(Python+Qt)学习随笔:QTableView的gridStyle属性

    老猿Python博文目录 老猿Python博客地址 概述 gridStyle属性用于控制视图数据网格的样式,此属性只有在showGrid属性为True时才有作用. gridStyle属性取值含义 gr ...

  10. 如何实现 token 加密(来自github每日一题)

    需要一个secret(随机数) 后端利用secret和加密算法(如:HMAC-SHA256)对payload(如账号密码)生成一个字符串(token),返回前端 前端每次request在header中 ...