Windows下Nginx安装配置教程

发布时间 - 2026-01-11 00:27:05    点击率:

首先去官网下载nginx1.0.11的Windows版本,官网下载

下载到软件包后,解压 nginx-nginx1.0.11.zip 包到你喜欢的根目录,并将目录名改为nginx。

然后,执行下列操作:

cd nginx

start nginx

这样,nginx 服务就启动了。打开任务管理器,查看 nginx.exe 进程,有二个进程会显示,占用系统资源,那是相当的少。然后再打开浏览器,输入http://127.0.0.1/ 就可以看到nginx的欢迎页面了,非常友好

nginx -s stop // 停止nginx
nginx -s reload // 重新加载配置文件
nginx -s quit // 退出nginx

接下来就是配置nginx的conf文件了。

下面是我的配置:

#user nobody;
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;

#keepalive_timeout 0;
keepalive_timeout 65;

gzip on;

include ../conf.d/*.conf;

#server {
# listen 80;
# server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

# location / {
# root html;
# index index.html index.htm;
# }

#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 http://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;
# }
#}
}

server {
 listen 80;
 server_name localhost;
 root e:/workspaces/react-project/build;
 location /api {
 proxy_pass http://127.0.0.1;
 }
}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。


# windows  # nginx  # windows系统安装配置nginx环境  # Nginx安装配置详解  # win10安装配置nginx的过程  # Linux服务器下安装配置Nginx的教程  # Windows Server 2016 Nginx 安装配置详细图文教程  # LNMP编译安装之nginx安装配置方法图文教程  # Linux下安装配置nginx详解  # Nginx安装配置的实现示例  # 官网  # 那是  # 软件包  # 并将  # 到你  # 然后再  # 二个  # 配置文件  # 大家多多  # 就可以  # 任务管理器  # 加载  # 打开浏览器  # 启动了  # 系统资源  # stream  # default_type  # application  # octet  # types 


相关栏目: 【 网站优化151355 】 【 网络推广146373 】 【 网络技术251813 】 【 AI营销90571


相关推荐: CSS3怎么给轮播图加过渡动画_transition加transform实现【技巧】  公司网站制作价格怎么算,公司办个官网需要多少钱?  Angular 表单中正确绑定输入值以确保提交与验证正常工作  如何在 Pandas 中基于一列条件计算另一列的分组均值  免费的流程图制作网站有哪些,2025年教师初级职称申报网上流程?  Laravel如何使用Passport实现OAuth2?(完整配置步骤)  Laravel中Service Container是做什么的_Laravel服务容器与依赖注入核心概念解析  java中使用zxing批量生成二维码立牌  网站制作怎么样才能赚钱,用自己的电脑做服务器架设网站有什么利弊,能赚钱吗?  JavaScript如何实现错误处理_try...catch如何捕获异常?  javascript中对象的定义、使用以及对象和原型链操作小结  HTML 中动态设置元素 name 属性的正确语法详解  原生JS获取元素集合的子元素宽度实例  宙斯浏览器视频悬浮窗怎么开启 边看视频边操作其他应用教程  5种Android数据存储方式汇总  Laravel Debugbar怎么安装_Laravel调试工具栏配置指南  做企业网站制作流程,企业网站制作基本流程有哪些?  如何挑选最适合建站的高性能VPS主机?  Win11怎么关闭资讯和兴趣_Windows11任务栏设置隐藏小组件  魔方云NAT建站如何实现端口转发?  简历在线制作网站免费版,如何创建个人简历?  详解vue.js组件化开发实践  网站视频制作书签怎么做,ie浏览器怎么将网站固定在书签工具栏?  如何在万网利用已有域名快速建站?  bing浏览器学术搜索入口_bing学术文献检索地址  Laravel如何发送系统通知_Laravel Notifications实现多渠道消息通知  Laravel如何实现URL美化Slug功能_Laravel使用eloquent-sluggable生成别名【方法】  微信小程序 HTTPS报错整理常见问题及解决方案  Laravel如何将应用部署到生产服务器_Laravel生产环境部署流程  Laravel的Blade指令怎么自定义_创建你自己的Laravel Blade Directives  Laravel如何获取当前用户信息_Laravel Auth门面获取用户ID  Laravel怎么写单元测试_PHPUnit在Laravel项目中的基础测试入门  网站页面设计需要考虑到这些问题  青岛网站建设如何选择本地服务器?  JS中使用new Date(str)创建时间对象不兼容firefox和ie的解决方法(两种)  香港服务器选型指南:免备案配置与高效建站方案解析  linux写shell需要注意的问题(必看)  详解Android——蓝牙技术 带你实现终端间数据传输  laravel怎么实现图片的压缩和裁剪_laravel图片压缩与裁剪方法  用v-html解决Vue.js渲染中html标签不被解析的问题  今日头条微视频如何找选题 今日头条微视频找选题技巧【指南】  Linux系统命令中tree命令详解  如何用低价快速搭建高质量网站?  如何在建站之星网店版论坛获取技术支持?  iOS中将个别页面强制横屏其他页面竖屏  标题:Vue + Vuex + JWT 身份认证的正确实践与常见误区解析  悟空识字怎么关闭自动续费_悟空识字取消会员自动扣费步骤  教你用AI将一段旋律扩展成一首完整的曲子  rsync同步时出现rsync: failed to set times on “xxxx”: Operation not permitted  如何用好域名打造高点击率的自主建站?