nginx

  

 

Compile:

 

 

 

 

yum install zlib-devel pcre-devel

 

 

 

 

 

 

 

 

 

   

复制代码
user bb;
worker_processes auto;
error_log logs/error.log notice;
pid /var/run/nginx.pid;

events {
  accept_mutex on;
  multi_accept on;
  worker_connections 2048;
  use epoll;
}

http {
  include mime.types;
  default_type application/octet-stream;
  sendfile on;
  keepalive_timeout 30;

  log_format s1 '------> s1';
  log_format s2 '------> s2';

  include conf.d/*.conf;
}

conf.d/

server {
  listen 8081;
  server_name localhost;
  access_log logs/s1.log s1;

  error_page 404 /404.html;

  location /s1/l1 {
    root /home/bb/web;
    index index1.html;
  }

  location /s1/l2 {
    root /home/bb/web1;
    index index2.html;
  }

  location = /404.html {
    root /home/bb/;
    index 404.html;
  }
}

server {
  listen 8082;
  server_name localhost;
  access_log logs/s2.log s2;

  error_page 404 /404.html;

  location /s2/l1 {
    root /home/bb/web2;
    index index1.html;
  }

  location /s2/l2 {
    root /home/bb/web2;
    index index2.html;
  }

  location = /404.html {
    root /home/bb;
    index 404.html;
  }
}
复制代码

 

 

 

正向代理:

 

 

 

 

 

 

结论: nginx正向代理非标准端口,需在正向代理中明确指定被代理server端口

 

posted @   ascertain  阅读(26)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2020-08-21 SQL server审核/审计
点击右上角即可分享
微信分享提示