nginx之搭建本地文件服务器(请求你本地的文件)

nginx相关
日志文件
./log/access.log
./log/error.log
nginx命令:
nginx -s reload # 重新加载配置
nginx -s stop # 直接杀死停止
nginx -s quit # 友好关闭
start nginx # 启动nginx
nginx -t #检测配置文件是否正确

搭载配置文件

复制代码
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  192.168.1.232;# 这个是部署地址的IP
        root   E:\xxxxxx;   #这个是根目录
        location / {
            index  index.html index.htm;#index文件,如果配置目录有就用,如果没有就会用nginx自带的
        }
    }
}
View Code
复制代码

然后几个关键截图:

 

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示