nginx反向代理搭建谷歌镜像
啥也不说了,直接上代码:
- server {
- listen 8000;
- server_name google.uol123.com;
- location / {
- #root "d:/wwwroot/test";
- #index index.html;
- #proxy_redirect off;
- proxy_pass https://www.google.com.hk/;
- proxy_redirect / https://www.google.com.hk/;
- proxy_set_header Host www.google.com.hk;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Accept-Encoding "";
- proxy_set_header User-Agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.49 Safari/537.36";
- #sub_filter www.google.com google.uol123.com;
- #sub_filter_once off;
- }
- }
估计有需要的人会用到,自己亲测在windows和Linux下面都可以使用。
============ 欢迎各位老板打赏~ ===========
与本文相关的文章
- · 使用tengine代替Nginx
- · nginx添加nginx_upstream_check_module
- · nginx上传文件超出默认大小限制,提示:413 Request Entity Too Large
- · nginx反向代理禁用缓存
- · docker nginx
- · consul+nginx完成集群服务动态发现和健康检查
- · nginx使用stream模块做ssh转发
- · nginx反向代理wss
- · nginx+keepalive负载均衡高可用
- · Linux下配置 nginx + .net core 2.0
- · nginx负载均衡 自动切换 超时时间
- · nginx+iis实现负载均衡