绕过深x服访问百d网站限制思路(随便写点没用的)

本文介绍了如何在Windows电脑上通过Nginx实现特定网址的反向代理,并配置SSL以支持HTTPS访问,包括修改host文件、设置SSL证书链和安全参数等步骤。
摘要由CSDN通过智能技术生成

介绍

sxf 电脑禁用了某些网址怎么办?下面介绍点歪货,看懂了就看懂了,看不懂加强学习
需要准备知识点(门槛): nginx 反向代理;会用window电脑百度,会修改电脑host ,会用电脑生成ssl

思路

这里就说一些大白话: nginx + 修改本地host

少废话上nginx配置

  1. nginx 代理代码块
location /
{
    expires 12h;
    if ($request_uri ~* "(php|jsp|cgi|asp|aspx)")
    {
         expires 0;
    }
    proxy_pass https://220.181.111.91;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;

    add_header X-Cache $upstream_cache_status;
    
    proxy_set_header Accept-Encoding "";
	
    sub_filter_once off;
    
    proxy_cache cache_one;
    proxy_cache_key $host$uri$is_args$args;
    proxy_cache_valid 200 304 301 302 12h;
}
  1. 修改host, 添加如下配置(简单的知识点)
    127.0.0.1 pan.baidu.com

  2. 启用nginx 80服务器
    光启用是没用的,需要https访问才行,所以你需要配置nginx 通过pan.baidu.com进来时候可以ssl访问
    贴点示例

server 
{
    listen 80;
	listen 443 ssl;
    server_name pan.baidu.com; 
    index index.php index.html index.htm default.php default.htm default.html;
    root D:/wwwroot/pan.baidu.com;
		
	#START-ERROR-PAGE
	#error_page 403 /403.html;
	error_page 404 /404.html;
    #error_page 502 /502.html;
	#END-ERROR-PAGE
    
    #HTTP_TO_HTTPS_START
    #HTTP_TO_HTTPS_END

    #LIMIT_INFO_START
    #LIMIT_INFO_END

    #SSL-INFO-START
    ssl_certificate    ssl/pan.baidu.com/fullchain.pem;
    ssl_certificate_key    ssl/pan.baidu.com/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497  https://$host$request_uri; 
    #SSL-INFO-END
        
    #反代清理缓存配置
    location ~ /purge(/.*) {
        proxy_cache_purge cache_one $1$is_args$args;
    }
    #proxy 反向代理
    include proxy/pan.baidu.com/*.conf;

    #PHP-INFO-START 
    include php/00.conf;
    #PHP-INFO-END
    
    #REWRITE-START
    include rewrite/pan.baidu.com/*.conf;
    #REWRITE-END

    #redirect 重定向
    include redirect/pan.baidu.com/*.conf;

    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }
    
    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }

	access_log  D:/BtSoft/wwwlogs/pan.baidu.com.log;
    error_log  D:/BtSoft/wwwlogs/pan.baidu.com.error.log;
}
  1. 生成ssl
    生产ssl 我不说,反正cmd直接完成,自己百度
  2. 把nginx启动了就行,
    访问效果
    在这里插入图片描述
  • 9
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值