使用宝塔面板 配置nginx 访问ftp服务器下面的图片
如果 你在服务器上 运行war项目 可以在tomcat 配置访问的:
tomcat 也贴出来吧!
一.tomca配置访问,需要更改配置文件server.xml ,如果找不到,自己好好找一下 一般在 tomcat/conf 这个目录下面
1.
截图:
2.
3.找到 <Host></Host> 这个标签
然后在<Host></Host>里添加<Context></>来实现映射功能
添加这一段:
直接放出来,你们可以复制
<Context path="/img" docBase="/img" reloadable="true"></Context>
然后就可以访问一下啦,图片访问成功
二 .配置nginx 访问ftp图片
1:进入配置文件的目录:
2;nginx的默认配置文件nginx.config
#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;
# }
#} }
三:配置图片服务器
方法一、在配置文件server{}中location /{} 修改配置:
#默认请求
location / {
root /home/ftpuser/www;#定义服务器的默认网站根目录位置
index index.html index.php index.htm;#定义首页索引文件的名称
}
截图:
测试:
使用宝塔面板 配置nginx 访问ftp服务器下面的图片的更多相关文章
- 浏览器通过http协议通过nginx访问ftp服务器上的文件
1.修改nginx配置文件 2.修改nginx默认目录为ftp默认目录 3.修改成自定义路径后,并修改此目录第一行,修改为root或是nginx用户 4.重新加载 cd /usr/local/ngin ...
- Linux_配置匿名访问FTP服务
[RHEL8]-FTPserver:[Centos7]-FTPclient !!!测试环境我们首关闭防火墙和selinux(FTPserver和FTPclient都需要) [root@localhos ...
- Nginx与ftp服务器
使用Nginx搭建ftp服务器
- windows客户端访问FTP服务器
客户端访问FTP服务器步骤: 首先双击此电脑,在弹出的窗口输入如下信息 刚安装完的FTP服务器只有一个pub目录,因为这里是使用匿名用户登录的 FTP服务器默认的匿名目录在/var/ftp/pub/下 ...
- 通过HTTP服务访问FTP服务器文件(配置nginx+ftp服务器)
1.前提 已安装配置好nginx+ftp服务 2.配置Nginx 服务器 2.1进入nginx 配置文件目录: cd /usr/local/nginx/conf vi nginx.conf 2.2 ...
- Server 主机屋云服务器 宝塔面板 部署nginx反向代理的vue项目
图文记录云服务器上部署需要nginx反向代理的vue项目: 一.先登录并购买云服务器,根据自己需求购买,此处不详细介绍: 二.登录后如下图,点击进入云服务器界面: 三.在云服务器界面点击管理,进入管理 ...
- 浏览器访问配置完成的ftp服务器
在浏览器的地址栏输入: ftp://testuser:testuser@192.168.10.4 testuser 是ftp的用户名和密码: 192.168.10.4 是ftp服务器的IP地址. 亲测 ...
- linux下配置nginx使用ftp目录作为静态资源文件的目标目录
1.安装ftp服务,可以直接yum install vsftpd. 2.设置随机启动,chkconfig vsftpd on. 3.启动ftp服务,service vsftpd start. 4.配置 ...
- 【原】Nginx搭建FTP服务器的细节问题
关于文件服务器很多实现方法,比如采用阿里的分布式文件系统FastDFS,以及自己内部搭建FTP服务器,这里记录一下关于nginx搭建FTP文件系统流程. ftp服务器搭建的步骤网上也是很多,这里贴一下 ...
随机推荐
- neo4j allshortestpaths查询路径不准确问题
同样是5年开发,年薪50万和年薪15万的差距在哪里-.>>> 基本语法 使用neo4j cypher查询语言的小伙伴都知道cypher提供了两个查询最短路径的特殊函数shortest ...
- 1.bash总体介绍
1.总体介绍1.1 什么是Bash?Bash(Borune-Again SHell)是一个用于Linux操作系统的shell,即命令解释器Bash与sh兼容,并从ksh和csh引进了一些有用的功能,在 ...
- CF1151F Sonya and Informatics
cf luogu 我们最终要的序列一定是前面全是0,后面全是1,假设总共\(m\)个0,那么这等价于前\(m\)位0的个数为\(m\).当然一开始可能数量没有\(m\) 那就把前\(m\)位0的数量作 ...
- golang利用beego框架orm操作mysql
GO引入orm框架操作mysql 在beego框架中引入orm操作mysql需要进行的步骤: 第一步:导入orm框架依赖,导入mysql数据库的驱动依赖 import ( "github.c ...
- php函数之substr()
问题: 希望从字符串的某个特定位置开始抽取这个字符串的一部分.例如,对于输入到一个表单的用户名,想要得到这个用户名的前8个字符. 解决: 使用substr()选择子串 $substring = sub ...
- 内存不足导致mysql关闭,CentOS6.5增加swap分区
某日发现mysql自动关闭了,查找错误日志发现以下错误 2017-07-14 13:07:30 5494 [Note] InnoDB: Initializing buffer pool, size = ...
- 利用mybatis-generator自动生成代码(转)
利用mybatis-generator自动生成代码 mybatis-generator有三种用法:命令行.eclipse插件.maven插件.个人觉得maven插件最方便,可以在eclipse/int ...
- SSD源码解读——损失函数的构建
之前,对SSD的论文进行了解读,可以回顾之前的博客:https://www.cnblogs.com/dengshunge/p/11665929.html. 为了加深对SSD的理解,因此对SSD的源码进 ...
- 运维学习篇之jenkins的安装(CentOS7)
一. 介绍 Jenkins是一个开源软件项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能二. 作用 1.持续的软件版本 ...
- DHCP服务部署
目录 DHCP服务部署 一. 简介 二. 用途及功能 三. 原理+示意图 四. 实战搭建 相关文件 配置基础DHCP服务器 配置DHCP保留地址 配置DHCP超级作用域 配置DHCP中继 五. 小结 ...