Windows环境下绿色版nginx 1.30使用

1.下载

下载地址:https://nginx.org/en/download.html

2.解压

将下载的安装包解压到:E盘下

3.使用

复制代码
主要差异点:
 upstream oa_cluster{
            # sticky;
            sticky cookie example;
            server 127.0.0.1:80 max_fails=300 fail_timeout=30s;
        }

nginx.conf

复制代码
worker_processes auto;
worker_rlimit_nofile 20960;
error_log  logs/error.log  error;
events {
    worker_connections  4096;
    multi_accept on;
    accept_mutex on;
    accept_mutex_delay 500ms;
}
http {
        server_tokens off;
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        access_log off;
        include       mime.types;
        default_type  application/octet-stream;
        keepalive_timeout  300;
        client_max_body_size 10240M;

        gzip on;
        gzip_min_length 1k;
        gzip_buffers 4 16k;
        gzip_comp_level 3;
        gzip_types text/xml text/plain text/css text/javascript application/x-javascript application/javascript application/xml;
        gzip_disable "MSIE [1-6]\.";
		
        upstream oa_cluster{
            # sticky;
            # 主要差异点
            sticky cookie example;
            server 127.0.0.1:80 max_fails=300 fail_timeout=30s;
        }

		# OA-http
        server {
            listen 8080;
            server_name localhost;
            charset utf-8;

            location / {
                proxy_pass http://oa_cluster;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header REMOTE-HOST $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_redirect http:// $scheme://;
                proxy_connect_timeout 300;
                proxy_read_timeout 300;
                proxy_send_timeout 300;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
		#OA-https
        server {
            listen 8443 ssl;
            server_name localhost;
            ssl_certificate cert.crt;
            ssl_certificate_key  cert.key;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            charset utf-8;

            location / {
                proxy_pass http://oa_cluster;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header REMOTE-HOST $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_redirect http:// $scheme://;
                proxy_connect_timeout 300;
                proxy_read_timeout 300;
                proxy_send_timeout 300;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    }
相关推荐
Sayai3 小时前
Neo4j 图数据质量检查实战:环路检测、孤立节点与连通分量,两条 Cypher 引出的数据体检清单(含变长路径性能陷阱)
运维·neo4j·图数据库·数据质量·cypher
Elastic 中国社区官方博客4 小时前
更少的位数,相同的召回率:DiskBBQ 更保守的自动校准扫描
大数据·运维·开发语言·人工智能·elasticsearch·搜索引擎
方便面不加香菜4 小时前
Docker Volume -- 管理卷Volume详解
运维·docker·容器
沫璃染墨4 小时前
从零入门计算机网络系列(十八):TCP连接管理详解——从三次握手与四次挥手到TIME_WAIT机制
运维·服务器·网络·c++·网络协议·tcp/ip·tcp
Felven4 小时前
华为鲲鹏920s芯片serdestool工具使用说明
linux·运维·服务器·华为·鲲鹏920·serdestool
江湖有缘5 小时前
Docker实战 | 使用Docker部署lemonitor镜像站点列表程序
运维·docker·容器
莫晓燚5 小时前
mall 电商项目完整部署---实战
linux·运维·docker·容器
爱和冰阔落5 小时前
【Linux网络】JsonCpp 怎么实现序列化?从 Request/Response 到网络计算器消息设计
linux·运维·网络·php
Decay__5 小时前
01_SQLServer 体系架构全解 —— 实例进程、关系引擎、SQLOS 与事务日志深入
运维·数据库·sql·mysql·架构
我是koten11 小时前
【运维杂谈】K8s遇到Terminating的名称空间删除不了怎么办?(解决方案亲测有效)
linux·运维·服务器·云原生·kubernetes·k8s·名称空间