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

相关推荐
bearpping8 小时前
Nginx 配置:alias 和 root 的区别
前端·javascript·nginx
肠胃炎14 小时前
挂载方式部署项目
服务器·前端·nginx
曲幽18 小时前
FastAPI实战:WebSocket vs Socket.IO,这回真给我整明白了!
python·websocket·nginx·socket·fastapi·web·async·socketio
袁庭新21 小时前
M系列芯片Mac上通过Homebrew一键安装/卸载Nginx并上线项目全指南
运维·nginx·macos·袁庭新·袁庭新ai
Densen201421 小时前
发布blazor应用到Linux, 使用nginx作为WebSocket代理
linux·websocket·nginx
不是书本的小明21 小时前
Apache vs Nginx vs Tomcat 核心区别与优化
nginx·tomcat·apache
困惑阿三2 天前
客户消息及时反馈
nginx·node.js·飞书·企业微信
liurunlin8882 天前
httpslocalhostindex 配置的nginx,一刷新就报404了
运维·nginx
BullSmall2 天前
Nginx负载均衡会话保持配置指南
运维·nginx·负载均衡