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

相关推荐
闲云一鹤12 小时前
nginx 快速入门教程 - 写给前端的你
前端·nginx·前端工程化
何中应4 天前
Nginx转发请求错误
前端·后端·nginx
芝士雪豹只抽瑞克五4 天前
Nginx 高性能Web服务器笔记
服务器·nginx
失重外太空啦4 天前
nginx
运维·nginx
天蓝不会忘记025 天前
lvs,haproxy,keepalived,nginx,tomcat介绍和实验
nginx·tomcat·lvs
feng68_5 天前
Nginx高性能Web服务器
linux·运维·服务器·nginx
unfeeling_5 天前
Nginx实验
运维·nginx
倚肆5 天前
在 Windows Docker 中安装并配置 Nginx (映射 Windows 端口与路径)
windows·nginx·docker
shawnyz5 天前
Nginx的源码编译
运维·nginx