• Linux Nginx反向代理小实例


    到此为止,我也不能说清楚什么事反向代理,我只知道nginx在签名做了一层代理,把请求都收到,然后分发给配置的真实的服务。并且把返回response给客户端;

    准备工作;安装好nginx;安装好apache;

    配置nginx代理;

    upstream site {
                server 120.25.153.74:8081;
                server 120.25.153.74:8082;
    }
    
    server {
      listen 80;
      server_name proxy.deetaa.com;
     
      #charset koi8-r;
     
      #access_log logs/host.access.log main;
     
      location / {
        root html;
        index index.html index.htm;
        proxy_pass http://site;
      }
    }

    Apache 配置:

    <VirtualHost *:8081>
        ServerAdmin cb@gosstech.net
        DocumentRoot "/home/apache/a1"
        ServerName localhost
    #   ServerAlias www.dummy-host.example.com:8081
        ErrorLog "logs/a1_error_log"
        CustomLog "logs/a1_access_log" common
        <Directory "/home/apache/a1/">
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        </Directory>
    </VirtualHost>
    
    <VirtualHost *:8082>
        ServerAdmin cb@gosstech.net
        DocumentRoot "/home/apache/a2"
        ServerName localhost
        ErrorLog "logs/a2_error_log"
        CustomLog "logs/a2_access_log" common
        <Directory "/home/apache/a2/">
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        </Directory>
    </VirtualHost>

    请修改配置文件httpd listen 8081 8082

    重启Apache nginx

    访问proxy.deetaa.com

    upstream site {            server 120.25.153.74:8081;            server 120.25.153.74:8082;}
    server {listen 80;server_name proxy.deetaa.com; #charset koi8-r; #access_log logs/host.access.log main; location / {root html;index index.html index.htm;proxy_pass http://site; }}

  • 相关阅读:
    一次zabbix的渗透
    Tips
    IPy
    文件读取漏洞路径收集
    argparse
    代码审计之配置
    ctf之加密
    内网渗透中的反弹Shell与端口转发
    利用zip(或者phar)协议进行本地文件包含
    104. 二叉树的最大深度
  • 原文地址:https://www.cnblogs.com/bin-pureLife/p/5091816.html
Copyright © 2020-2023  润新知