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

相关推荐
Csvn6 小时前
Nginx 反向代理入门:proxy_pass 两种形态、超时链与 502/504 分辨
后端·nginx
yyuuuzz9 小时前
nginx 502 排查,先看上游超时那一行
android·java·运维·nginx·502
月夏13 小时前
我把全栈项目塞进已有 nginx 的服务器,卡我最久的是三个斜杠
nginx·react.js·docker
飞奔的瓜牛1 天前
Nginx 实现TCP与UDP转发:新版与老版本配置详解
tcp/ip·nginx·udp
飞奔的瓜牛1 天前
Nginx 生产环境运维实践:常见问题、关注要点与日常维护
运维·nginx
飞奔的瓜牛1 天前
Nacos 三节点集群部署手册:MySQL 持久化 + Nginx 负载均衡
mysql·nginx·负载均衡
Csvn2 天前
Nginx 静态站点与 location 匹配:优先级、alias、缓存头与 gzip
后端·nginx
考虑考虑2 天前
nginx拦截url
运维·后端·nginx
李纲明3 天前
WordPress 打开站点却直接下载文件或源码而不显示页面:先核 PHP 处理规则,再查 443 是否被其他站接管
nginx·wordpress·443·php解析·站点配置·devdiy·直接下载
Java码农也是农3 天前
一篇文章讲清 NGINX 反向代理:location、proxy_pass、负载均衡与排错
nginx·负载均衡·后端开发·反向代理·proxy_pass