本文主要介绍一些Nginx做图片主机的简单配置,但不包括Nginx的安装部署以及实现原理。
配置步骤
下载nginx
Windows nginx安装教程及简单实践
配置nginx\nginx-1.13.4\conf\nginx.conf文件
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_age
注意:d:/pinkylam_server/ 对应的文件夹要建立。
测试
打开浏览器输入http://127.0.0.1/111.jpg测试。
预览
最基础的nginx图片主机就搭建完成了。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持本站。