nginx内网代理为外网地址
#user nobody;
worker_processes 1; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections 1024;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout 65; #gzip on; server {
listen 80;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm;
}
location /openweixin/ {
proxy_pass https://open.weixin.qq.com/;//这个就是配置代理地址出去的
} location /qyapiweixin/ {
proxy_pass https://qyapi.weixin.qq.com/; } location /openworkweixin/ {
proxy_pass https://open.work.weixin.qq.com/; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen 443;
# server_name localhost; # ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }
nginx内网代理为外网地址的更多相关文章
- openvpn实现内网 映射到 外网
openvpn实现内网 映射到 外网 场景介绍: 机器介绍 本地一台Ubuntu服务器A , 处于内网中 , 无外网IP 外网一台Ubuntu服务器B , 外网地址139.199.4.205 目标 : ...
- 内网IP和外网IP
1.什么是内网内网就是局域网,比如一个公司的局域网,局域网内每台计算机的IP地址是互异的,但不同局域网内的IP是可以相同的.2.什么是外网外网就是互联网,内网的所有计算机都是连接到一个外网IP,通过外 ...
- 关于session失效的问题(内网IP与外网IP)
参考: 测试环境测试支付宝支付,以ip方式访问,而支付宝支付成功后回调地址配置的是域名形式的.造成支付成功后访问成功页面进入了登录页面 同一个网站,通过域名登录和通过IP登录,所产生的session是 ...
- iptables 实现centos内网机器访问外网
环境:一台带外网和内网的机器,另一台只有内网,默认不能上网.两台机器都是centos系统带外网机器的外网ip为 123.221.20.11, 内网ip为 192.168.15.100内网机器的内网ip ...
- linux内网机器访问外网代理设置squid
公司一般出于安全考虑, 在同一局域网中只有一台机器可以访问外网,运维进行了整体的限制, 但是在后面的工作中,需要在机器上安装一些软件,及命令,所以其他的机器需要访问外网来简化工作, 但又不能打乱原有运 ...
- 【C#】C#获取本地的内网(局域网)和外网(公网)IP地址的方法
1.获取本机的IP地址集合: /// <summary> /// 获取本机所有ip地址 /// </summary> /// <param name="netT ...
- 内网服务器通过Squid代理访问外网
环境说明 项目整体需部署Zabbix监控并配置微信报警,而Zabbix Server并不能访问外网,故运维小哥找了台能访问外网的服务器做Suqid代理,Zabbix Server服务器通过代理服务器访 ...
- 用iptables做NAT代理,使内网机器上外网
现状:服务器A只有一个内网IP,不能上外网,内网IP与服务器B内网相通:服务器B有一个内网IP和公网IP.想实现服务器A也能上外网. 1 2 3 4 服务器A:内网网卡:eth0 内网IP:192.1 ...
- 根据Request获取客户端IP 内网IP及外网IP
在JSP里,获取客户端的IP地址的方法是:request.getRemoteAddr() ,这种方法在大部分情况下都是有效的.但是在通过了Apache,Squid等反向代理软件就不能获取到客户端的真实 ...
随机推荐
- jQuery-File-Upload外部按钮触发上传
这个控件功能还不错,但是对于外部调用上传有点压力. 比如说,他可以实现在添加一个文件后为文件添加一个上传按钮,这个是写在add中的,可以调用data.submit()提交数据 但是如果我要实现外部按钮 ...
- Arduino Nano 读取ADS1100实例
利用Arduino Nano的wire库可以很方便对ADS1100进行设置和读取转换后的数据. /* * Arduino reads ADS1100 I2C 16bit diff ADC */ /* ...
- [LeetCode 题解]: Two Sum
前言 [LeetCode 题解]系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given an a ...
- TDE--相关Demo
SQL Server 2008引入透明数据加密(Transparent Data Encryption),它允许你完全无需修改应用程序代码而对整个数据库加密.当一个用户数据库可用且已启用TDE时,在写 ...
- Docker 1.3.3/1.4.0 发布下载,Linux 容器引擎
Docker 1.3.3 发布,下载地址: https://github.com/docker/docker/archive/v1.3.3.zip 改进记录包括: Security Fix path ...
- Fiddler2抓包
https://www.cnblogs.com/conquerorren/p/8472054.html https://www.cnblogs.com/conquerorren/p/8472218.h ...
- RabbitMQ与.net core(三) fanout类型Exchange 与 消息的过期时间 与 队列的存活时间
上一篇我们讲了关于direct类型的Exchange,这一片我们来了解一下fanout类型的Exchange. 1.Exchange的fanout类型 fanout类型的Exchange的特点是会把消 ...
- 【Selenium专题】WebDriver启动Chrome浏览器(一)
selenium操作chrome浏览器需要有ChromeDriver驱动来协助.一.什么是ChromeDriver?ChromeDriver是Chromium team开发维护的,它是实现WebDri ...
- Eclipse无法正常创建android工程解决方法!
我最近升级了安卓的SDK,升级后发现无法在Eclipse中创建android工程了,创建的工程完毕后,没有自动生成这个工程的activity和对应的布局文件,上网搜索一番,最后终于解决了.可能是升级后 ...
- opencv+opencv_contrib 人脸识别和检测 python开发环境快速搭建(30分钟)图文教程
很多朋友为了学习python.ML(机器学习).DL(深度学习).opencv等花费了大量时间配置安装环境(一个朋友花了4天时间才配置好)各种搜索.下载.安装配置,出问题等. 市面上的配置资料很多,选 ...