Nginx简介

  • Nginx是一个高性能的HTTP和反向代理服务器;
  • 支持的操作系统众多,windows、linux、 MacOS X;
  • 可实现负载均衡;
  • Rewrite功能强大;
  • 电商架构大部分都采用Nginx+应用服务器(如:Tomcat等web服务器)的架构。

目录说明

  Nginx简介及配置实用

  • conf – 配置文件
  • contrib – 存放一些实用的工具
  • docs – 文档
  • html – 静态页面
  • logs – 日志
  • tmp – 临时目录
  • nginx.exe  主服务

操作(windows)

  注:(nginx.exe)不能双击打开!

  • 启动:start nginx.exe
  • 停止:nginx.exe -s stop
  • 重新加载:nginx.exe -s reload

操作(mac)

nginx配置

  D:\soft\nginx-1.5.1\conf\nginx.conf

server {
        listen       80; #监听端口
        server_name  manage.taotao.com; #请求访问的域名
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
    proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        location / {
            proxy_pass http://127.0.0.1:8081; #反向代理到的Tomcat
            proxy_connect_timeout 600; #连接超时时间
          proxy_read_timeout 600; #读取超时时间
        }
        
}

 

相关文章:

  • 2022-01-12
  • 2021-07-08
  • 2021-10-16
  • 2021-11-23
  • 2021-05-07
  • 2021-06-29
  • 2022-01-01
猜你喜欢
  • 2021-12-14
  • 2021-12-27
  • 2021-06-24
  • 2022-02-04
  • 2021-12-18
  • 2021-08-16
相关资源
相似解决方案