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/ 查看静态文件

相关推荐
全栈工程师修炼指南5 小时前
Nginx | ngx_cache_purge 模块:实现清除特定上游服务(后端)响应缓存条目
运维·nginx·缓存
irisart7 小时前
第二章【NGINX 开源功能】—— 四层反向代理
运维·nginx·开源
MACKEI7 小时前
图片加速效果验证与查看
nginx
qinyia8 小时前
WisdomSSH解决Ubuntu 25.04服务器上因dpkg中断导致的Nginx安装失败问题并成功部署科技感个人主页
服务器·nginx·ubuntu
tzhou644521 天前
Docker 部署 Nginx HTTPS 服务(CentOS 7)
nginx·docker·https
等什么君!1 天前
nginx启动失败 ,报404和 idea端口号被占用的解决办法
运维·nginx
全栈工程师修炼指南1 天前
Nginx | HTTP 反向代理:当缓存失效时如何减轻后端(上游)服务压力?
运维·网络协议·nginx·http·缓存
zhengxianyi5152 天前
vue 首屏加载优化
前端·javascript·vue.js·nginx·gzip·expires·静态文件缓存
全栈工程师修炼指南2 天前
Nginx | HTTP 反向代理:对上游服务端响应缓存流程浅析与配置实践
运维·网络协议·nginx·http·缓存