Nginx for windows(网页Web服务器)下载

分类:服务器区 软件版本:v1.21.2 官方最新版 大小:1.6M 更新日期:2024年11月2日
本站评级:★★★★☆ 语言:简体中文 授权版本:免费 运行环境:Windows 11,Windows 10,Windows 8,Windows 7

Nginx for windows(网页Web服务器) v1.21.2 官方最新版


nginx for windows是一款功能轻量级的Web 服务器,现在很多反向代理服务器及电子邮件(IMAP/POP3)代理服务器,不仅可以减小服务器压力,同时也提高安全度。

关于Nginx

Nginx是Apache服务器不错的替代品:Nginx在美国是做虚拟主机生意的老板们经常选择的经常用的软件平台之一。能够支持高达 50,000 个并发连接数的响应。笔者将会应用于Nginx将默认网址应用于的80端口与tomcat应用于的8080端口进行对接,实现应用于80端口(域名)访问Tomcat下的网页,并配置HTTPS协议提高安全性。

安装提示

1、安装的说明

下载后解压得到如下一些文件

nginx windows稳定版

首先需要域名和SSL证书来配置HTTPS协议,SSL证书可以从很多地方获取或者自己创建

这里以腾讯云的CA证书为例子,有了域名和SSL证书后,按照腾讯云的官方提示,将配置Nginx的安全证书(.crt)和注册表项(.key)放到Nginx解压目录下的conf文件夹下方便管理【证书的名字这里改为1.crt和2.key】

nginx windows稳定版

然后需要将其配置到Nginx中,修改conf目录下的nginx.conf文件如下:

#user  nobody;

#user root;

worker_processes  1;

#error_log  logs/error.log;

#error_log  logs/error.log  notice;

#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {

worker_connections  1024;

}

http {

include       mime.types;

default_type  application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

#                  '$status $body_bytes_sent "$http_referer" '

#                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;

sendfile        on;

#tcp_nopush     on;

charset utf-8;

#keepalive_timeout  0;

keepalive_timeout  120;

#gzip  on;

#填写自己的服务器ip和Tomcat端口

upstream local_tomcat {

server xxx.xxx.xxx.xxx:8080;

}

server {

listen 80 default_server;

listen 443 ssl;

charset utf-8;

#填写自己的网站域名

server_name  www.xxxx.xxx;

#证书文件

ssl_certificate C:/nginx-1.12.2/conf/1.crt;

#私钥文件

ssl_certificate_key C:/nginx-1.12.2/conf/2.key;

ssl_session_timeout 5m;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;

ssl_prefer_server_ciphers on;

#配置HTTPS 

location ~ /^[H,h][T,t][T,t][P,p][S,s]/ {

#网站根目录,为Tomcat下的wepapps目录

root C:/Tomcat7/apache-tomcat-7.0.82/webapps;

proxy_pass https://127.0.0.1:8080;

proxy_set_header Host $http_addr;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location ~ \.jsp$ {

root C:/Tomcat7/apache-tomcat-7.0.82/webapps;

proxy_pass https://local_tomcat;

proxy_set_header Host $host:$server_port;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Real-PORT $remote_port;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location ~ \.html$ {

root C:/Tomcat7/apache-tomcat-7.0.82/webapps;

proxy_pass https://127.0.0.1:8080;

proxy_set_header Host $http_addr;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location / {

root C:/Tomcat7/apache-tomcat-7.0.82/webapps;

proxy_pass https://127.0.0.1:8080;

proxy_set_header Host $http_addr;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html

#

error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   html;

}

# proxy the php scripts to Apache listening on 127.0.0.1:80

#

#location ~ \.php$ {

#    proxy_pass   https://127.0.0.1;

#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

#location ~ \.php$ {

#    root           html;

#    fastcgi_pass   127.0.0.1:9000;

#    fastcgi_index  index.php;

#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

#    include        fastcgi_params;

#}

# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one

#

#location ~ /\.ht {

#    deny  all;

#}

}

# another virtual host using mix of IP-, name-, and port-based configuration

#

#server {

#    listen       8000;

#    listen       somename:8080;

#    server_name  somename  alias  another.alias;

#    location / {

#        root   html;

#        index  index.html index.htm;

#    }

#}

# HTTPS server

#

#server {

#    listen       443 ssl;

#    server_name  localhost;

#    ssl_certificate      cert.pem;

#    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;

#    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;

#    ssl_prefer_server_ciphers  on;

#    location / {

#        root   html;

#        index  index.html index.htm;

#    }

#}

}

2、 运行Nginx:

打开命令提示符跳转到nginx解压目录输入nginx

出现上述提示说明启动nginx失败,是由于电脑的80端口已经被占用,占用80端口的原因和解除方式都有很多种,例如SQLServer的ReportingServicesService占用,Apache,iis,或者其他原因,笔者在这就不说明怎么解除占用了

解除占用后正常启动如下图:可以在任务管理器看到有两个nginx程序在运行,至于为什么是两个,可以查看Nginx官方的文档,不解释了

nginx windows稳定版

3、关于应用于

开启Nginx,Tomcat。打开浏览器输入http(s)://你的域名/项目文件名/文件名即可进行访问

例如笔者配置的服务器(如果我的服务器开着的话可以访问。。。):

nginx windows版

应用于注意事项:

1 首次安装Nginx时,不要直接点击nginx.exe程序,否则会导致很多问题,当配置完成后,以后再开启nginx即可直接点击nginx.exe程序,不需要再应用于命令提示符操作,附nginx的基本操作指令:

开启:start nginx

检查配置文件:nginx -t -c C:/nginx-1.12.2/conf/nginx.conf

重新加载配置文件(很实用的指令):nginx -s reload

快速停止:nginx -s stop

完整停止:nginx -s quit

2 检测配置文件没有问题,但是应用于HTTPS不能访问,可能是由于防火墙的原因,可以将其关闭试试,成功后,可以自己配置防火墙入网规则,将80(Nginx),443(SSL),1433(sql server),8080(Tomcat)等等端口添加至防火墙里,来继续开启防火墙(我当时就是在这麻烦了很久)

3 有些nginx.conf配置不正确会导致访问网页时样式文件(js、css)不能一起返回,经过测试,笔者的配置是没有这个问题的

ps:感谢作者:芸灵fly分享的教程

更新日志:

v1.19.9版本更新

修复 nginx 在应用于邮件代理模块 (mail proxy module) 时无法构建的问题,应用于 ngx_mail_ssl_module 则正常。这个错误出现在 1.19.8 中

修复当与 gRPC 后端搭配应用于时,可能出现"upstream sent response body larger than indicated content length"错误。这个问题出现在 1.19.1 中

如果客户端在丢弃请求体的同时关闭了连接,nginx 可能在 keepalive 超时前不会关闭连接

当等待 auth_delay 或 limit_req 延迟时,或者与后端一起搭配应用于时,nginx 可能无法检测到客户端已经关闭的连接

修复 eventport 方法中的错误

v1.2.8版本更新

新的会话没有如果“ssl_session_cache共享”指令用于存储和共享内存中有没有免费的空间。感谢彼得·西科拉。

如果子请求应用于一个DNS子请求处理过程中发生了错误的反应可能会挂起。感谢到Lanshun周。

在的ngx_http_mp4_module。由于赫尔诺特Vormayr。 *)修正:在后端应用于的计数。

v1.2.12版本更新

变量支持在“proxy_bind”,“fastcgi_bind”,“memcached_bind”,“scgi_bind”,和“uwsgi_bind”指令。

管,request_length,$ time_iso8601,美元和$time_local变量,现在不仅可以在“log_format”应用于指令。

支持IPv6ngx_http_geoip_module。

修正指令“proxy_method”。

修正一个分割故障可能发生在工作进程中,如果应用于的投票方法解析。

修正nginx的可能霸占CPU在SSL握手与后端的选择,投票,或应用于/ dev / poll的方法。

修正“暴击SSL_write()失败(SSL:)”的错误。

修正“client_body_in_file_only”指令的错误。

修正指令“fastcgi_keep_conn”。

v1.2.2版本更新

修复了应用于 try_files 时可能导致的段错误的问题,该问题出现在 1.1.19 版本

当缓冲超过 IOV_MAX 时可能会导致响应被截断

修复了 image_filter 指令应用于 crop 参数的问题

版权声明:Nginx for windows(网页Web服务器)所展示的资源内容均来自于第三方用户上传分享,您所下载的资源内容仅供个人学习交流使用,严禁用于商业用途,软件的著作权归原作者所有,如果有侵犯您的权利,请来信告知,我们将及时撤销。


软件下载信息清单:


软件名称 发布日期 文件大小 下载文件名
Nginx for windows(网页Web服务器)安装包 2024年11月2日 1.6M Nginx_v1.21.20_qudong9.com.zip
下载地址:
相关推荐: 驱动大全 / 软件下载

软件评论

昵称*

手机*

网址

驱动总数
22526+
文章总数
3520+
评论条数
265+
运行天数
300+