Nginx安装

1、下载

https://nginx.org/en/download.htmlhttps://nginx.org/en/download.html

2、命令

start nginx --启动Nginx

nginx -s stop --停止Nginx

nginx -V --查看版本

nginx -s reload --重加载Nginx配置

nginx -t --验证Nginx配置

start nginx -s reload --重启Nginx

3、示例

3.1、静态文件服务器

nginx.conf 配置

复制代码
# user  nobody;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       8088;
        server_name  localhost;

        location / {
            root   "C:/Program Files/PEER Group/PTO 8.6 SP2/avalonia-sample/src/AvaloniaSample/releases/windows-x64";
            index  index.html index.htm;
            autoindex on;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

http://localhost:8088/ 查看静态文件

相关推荐
xixingzhe221 分钟前
SpringBoot + Nginx 免鉴权接口安全防护方案
运维·nginx·安全
酷炫的水壶8 小时前
使用memc-nginx和srcache-nginx模块构建高效透明的缓存机制
运维·nginx·缓存
智商偏低10 小时前
Windows Nginx 完整安装 + 启动教程
运维·nginx
oscar99914 小时前
3.4 Nginx 负载均衡——动态再平衡的反人性纪律
nginx·github·负载均衡·财富源代码
川石课堂软件测试16 小时前
性能测试|Nginx中间件监控与调优
linux·python·nginx·中间件·单元测试·压力测试·harmonyos
m0_740859621 天前
Nginx进行配置文件拆分(以windows解压版为例)
nginx
开发小程序的之朴1 天前
认识安企CMS-安装安企CMS的环境要求
nginx·golang·系统架构
考虑考虑1 天前
nginx配置ssl
运维·后端·nginx
至乐活着2 天前
ELK日志系统从零搭建到实战:Nginx日志采集与可视化全攻略
nginx·elk·elasticsearch·docker·日志系统
激情的学姐2 天前
【大型网站技术实践】初级篇:借助Nginx搭建反向代理服务器
运维·nginx