惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
V
Visual Studio Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
博客园_首页
Recent Announcements
Recent Announcements
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
Cisco Talos Blog
Cisco Talos Blog
L
LINUX DO - 最新话题
V2EX - 技术
V2EX - 技术
Simon Willison's Weblog
Simon Willison's Weblog
P
Palo Alto Networks Blog
PCI Perspectives
PCI Perspectives
T
Troy Hunt's Blog
Hacker News: Ask HN
Hacker News: Ask HN
S
Security Affairs
量子位
The Register - Security
The Register - Security
腾讯CDC
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题
N
News and Events Feed by Topic
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
TaoSecurity Blog
TaoSecurity Blog
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
H
Hacker News: Front Page
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
NISL@THU
NISL@THU
Know Your Adversary
Know Your Adversary
C
CXSECURITY Database RSS Feed - CXSecurity.com

博客园 - 找不到Object

57.基于springboot+vue的宠物领养平台 达梦数据库导出表结构到excel中 vware中centos虚拟机系统和宿主使用同一局域网 Excel中利用vba代码导出图片时以某一单元格内容重命名 vware中ubuntu虚拟机系统和宿主使用同一局域网 mysql查询近几天sql centos7离线安装docker liunx虚拟机VMware增加磁盘空间后,挂载磁盘 liunx服务器22端口开启 centos 7 NTP离线安装部署 centos7安装nginx centos7通过docker安装mysql centos7下安装docker VMware 虚拟机下CentOS 7连接网络 在JSP中使用el函数标签获取默认值(男女性别选项) ssm登录与退出 MVC(Model -View-Controller)实例应用模式 MVC模式 设计模式浅谈
nginx常用配置说明
找不到Object · 2021-05-28 · via 博客园 - 找不到Object

数据库地址转发

stream {
    upstream cloudsocket {
       hash $remote_addr consistent;
       server 192.168.100.20:3306 weight=5 max_fails=3 fail_timeout=30s;
    }
    server {
       listen 33060;#数据库服务器监听端口
       proxy_connect_timeout 10s;
       proxy_timeout 300s;#设置客户端和代理服务之间的超时时间,如果5分钟内没操作将自动断开。
       proxy_pass cloudsocket;
    }
}

proxy_pass配置

1.proxy_pass http://127.0.0.1:8080; 后面8080有 “/”

server {
        listen      80;
        server_name www.test.com;
        
        # 当访问 http://test.yeguxin.top/proxy/aaa/bbb.text时,nginx匹配到 /proxy/路径,把请求转发给127.0.0.1:8080服务.
        # 实际请求代理服务器路径为 " 127.0.0.1:8080/aaa/bbb.text "
        location /proxy/ {
             proxy_pass http://127.0.0.1:8080/;
        }
    }

2. proxy_pass http://127.0.0.1:8080; 后面8080没有 “/”

 server {
        listen      80;
        server_name www.test.com;
        
        # 当访问 http://test.yeguxin.top/proxy/aaa/bbb.text时,nginx匹配到 /proxy/路径,把请求转发给127.0.0.1:8080服务.
        # 实际请求代理服务器路径为 " 127.0.0.1:8080/proxy/aaa/bbb.text "
        location /proxy/ {
             proxy_pass http://127.0.0.1:8080;
        }
    }

3. proxy_pass http://127.0.0.1:8080/static; 后面static没有 “/”

   server {
        listen      80;
        server_name www.test.com;
        
        # 当访问 http://test.yeguxin.top/proxy/aaa/bbb.text时,nginx匹配到 /proxy/路径,把请求转发给127.0.0.1:8080服务.
        # 实际请求代理服务器路径为 " 127.0.0.1:8080/staticaaa/bbb.text "
        location /proxy/ {
             proxy_pass http://127.0.0.1:8080/static;
        }
    }

4.proxy_pass http://127.0.0.1:8080/static; 后面static有 “/”

 server {
        listen      80;
        server_name www.test.com;
        
        # 当访问 http://test.yeguxin.top/proxy/aaa/bbb.text时,nginx匹配到 /proxy/路径,把请求转发给127.0.0.1:8080服务.
        # 实际请求代理服务器路径为 " 127.0.0.1:8080/static/aaa/bbb.text "
        location /proxy/ {
             proxy_pass http://127.0.0.1:8080/static/;
        }
    }

5.最基本proxy_pass 用法

  server {
    listen      80;
    server_name chat.paas.scorpio.uat.newtank.cn;
    
     # 转发请求到 http://www.example.com
    location / {
        proxy_pass http://www.example.com;
    }
}

6.二级域名转发

 server {
    listen      5599;
    server_name localhost;

    location / {
        proxy_pass http://www.baidu.com;
    }
}    
 server {
    listen      5598;
    server_name localhost;
    
    location /jinpg/ {
        proxy_pass http://127.0.0.1:5599/;
    }
}