拟机搭建的ngnix和vsftpd的问题
虚拟机搭建的ngnix 和 vsftpd服务器物理机浏览器不能访问。
主机电脑通过ftp工具能访问。但是上传的图片物理机浏览器不能访问。
主机电脑通过ftp工具能访问。但是上传的图片物理机浏览器不能访问。
搭建ngnix 和vsftpd服务器 用来供主机做图片服务器使用。
使用filezilla 和自己的电脑都能下载访问。但是浏览器上不能访问,因为要用做图片服务器。如果访问不了就不知道怎么办了。
新手学习。请高人指点!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
你的截图显示你的图片根本就不在/home/www下,你的ftp不是上传到/home/ftpuser/www/ 吗?那你的root应该是/home/ftpuser/www/。 最后确保你的nginx使用的用户能访问到/home/ftpuser/www/。把目录权限看看,再看看日志文件的报错
引用来自“Feng_Yu”的评论
我知道为啥了,你的nginx是在sbin目录下启动的,root配置的是html,所以实际上nginx是从sbin/html下面去找静态资源去了。
建议你把root指令改为绝对路径,如root /var/www/html
非常感谢你的解答。问题就出来路径的问题。灰常感谢。
我知道为啥了,你的nginx是在sbin目录下启动的,root配置的是html,所以实际上nginx是从sbin/html下面去找静态资源去了。
建议你把root指令改为绝对路径,如root /var/www/html
问题就是我的filezalli能访问我的图片服务器。但是浏览器访问http://192.168.40.131/images/1.jpg 访问不了。这里的www目录是浏览器访问的默认目录吗?我这里不知道怎么回事。
这是防火墙配置文件
这是selinux
ftp_home_dir --> on修改了。
nginx 能正常访问
这是nginx.conf
配置信息在下面。
nginx的路径对不对 ??还有文件的权限
配置信息在下面
你也把你的nginx配置文件贴出来啊