Windows搭建简单图片服务器
实验需求
1#需求:某些网站上传图片,只能上传链接。能够使用 http://IP/目录/图片名 访问服务器已经存在的图片
2#解决方案:基于Nginx搭建图片服务器,提供链接浏览
#Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务。
准备环境
Nginx下载
安装
1.解压
2.编辑配置文件
#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_agent" "$http_x_forwarded_for"';#access_log logs/access.log main;sendfile on;#tcp_nopush on;#keepalive_timeout 0;keepalive_timeout 65;#gzip on;server {listen 80;server_name localhost;#charset koi8-r;#access_log logs/host.access.log main;location / {root html;index index.html index.htm;}#error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {# proxy_pass http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {# root html;# fastcgi_pass 127.0.0.1:9000;# fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;# include fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {# deny all;#}}# another virtual host using mix of IP-, name-, and port-based configuration##server {# listen 8000;# listen somename:8080;# server_name somename alias another.alias;# location / {# root html;# index index.html index.htm;# }#}# HTTPS server##server {# listen 443 ssl;# server_name localhost;# ssl_certificate cert.pem;# ssl_certificate_key cert.key;# ssl_session_cache shared:SSL:1m;# ssl_session_timeout 5m;# ssl_ciphers HIGH:!aNULL:!MD5;# ssl_prefer_server_ciphers on;# location / {# root html;# index index.html index.htm;# }#}# Serving Static Contentserver {listen 8080;server_name localhost;location /pic/ {root C:;}}}
图片存放位置 C:\pic,添加最后一段即可。
3.启动Ngnix
#复制以下内容保存到记事本,后缀改成bat启动脚本#
nginx.exe -c C:\nginx-1.10.1\conf\nginx.conf
后面是nginx的配置文件位置
4.验证
http:ip:8080/pic/images
##云服务器注意开通8080端口,其他没啥,这种方法也可以用于资源下载。##
Windows搭建简单图片服务器相关推荐
- 利用nginx搭建简单图片服务器实现负载均衡
在我们搭建一个网站的时候,往往有时候会加载更多的图片,如果都从tomcat服务器来获取静态资源,这样会增加我们服务器的负载,使得服务器运行 速度非常慢,这时我们可以使用nginx服务器来加载这些静态资 ...
- win10环境下搭建IIS图片服务器
Win10环境下搭建IIS图片服务器 背景交代:项目开发中在不依赖后端接口的前提下 前端基于mock获取数据,涉及到图片这块,需要完全还原线上场景,多以需要将图片放在服务器上.所以需要在本地利用win ...
- FastDFS搭建单机图片服务器(二)
FastDFS搭建单机图片服务器(二) 根据 分布式文件系统 - FastDFS 在 CentOS 下配置安装部署 和 分布式文件系统 - FastDFS 配置 Nginx 模块及上传测试 一步一步搭 ...
- 【图片服务器】搭建Nginx图片服务器
一.安装Nginx 二.安装vsftpd 三.开始搭建Nginx图片服务器 1.效果 例如:图片通过ftp服务上传到/home/ftpuser/www/images目录下,我想通过访问Nginx服务器 ...
- 安装nginx并搭建nginx图片服务器
1.安装所需的包:yum install -y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp curl curl-de ...
- 【转载】Windows搭建NTP始终服务器
转载自百度:windows搭建NTP时钟服务器(win xp.7.8.10) 1.修改注册表项.在搜索框中打开注册表,使用命令: regedit 2.进入注册表项HKEY_LOCAL_MACHINE- ...
- 随笔:使用Windows搭建AAA认证服务器
使用Windows搭建AAA认证服务器 前言: 一.AD域安装 1.添加角色和功能 2.添加角色和功能 3.添加角色和特征 4.服务器池选取 5.添加AD域服务,同时添加所需功能 6.根据提示操作,下 ...
- 搭建Nginx图片服务器
一.安装Nginx 先安装Nginx,看我之前发的文章: 搭建Nginx服务器 二.安装vsftpd 再安装vsftpd组件,看我之前发的文章: Linux安装ftp组件(8步完成) 三.开始搭建Ng ...
- Golang编写简单图片服务器
Golang编写简单图片服务器 图片服务器 最近的开发过程中,遇到一个问题,就是大量零碎图片的存储,最后我决定研究一个简单的图像服务器,以解决图像文件存储的性能问题.在此,写一篇博文记录我经历的思想过 ...
最新文章
- 【剑指offer-Java版】12打印1到最大的n位数
- sql server中创建链接服务器图解教程
- 875. 爱吃香蕉的珂珂(二分)
- 零拷贝概念 -- linux内核
- aws lambda_API网关和AWS Lambda进行身份验证
- 微信小程序 - 回到自己位置(map)
- 一个简单的高并发的回应服务器(5万并发)
- Cissp全过程(简介到考试后)
- springboot logback 调整 mybatis 日志级别无效
- tiledmap 图块属性_TiledMap地图使用
- roboware studio教程_Roboware Studio 简单使用与调试(ROS kinetic)
- php页面中播放flv视频,页面播放flv格式视频[原创]
- html+js经纬度输入框值的范围限制和输入限制
- QAC/QAC++静态软件代码测试分析-试用工具
- 【论文阅读】Single- and Cross-Modality Near Duplicate Image PairsDetection via Spatial Transformer Compar
- js如何删除数组第一个和最后一个元素和数组里添加元素
- 特征变换:特征归一化(Normalization)作用以及方法 Min-Max、Z-Score
- Python用tushare库获取股票数据批量存入mysql成功
- 有联系的标识变量的变化一定要同步
- H265框架编码流程(一),网易Android面试必问