appfront.fecshop.com无法访问,图片也加载不到;

安装报错 · mixiansheng · 于 5年前 发布 · 1900 次阅读

学习fecshop遇到问题 宿主主机是代理上网,我在虚拟及centos7上通过nat上网,用docker安装了fecshop1.6.20的版本,配置好了hosts文件,但是访问appfront.fecshop.com,无法访问 访问appadmin.fecshop.com可以访问但是图片加载不了,

加载apphtml5.fecshop.com也是图片加载不了第一个报错是502

希望老师能给说说解决思路

共收到 18 条回复
Fecmall#15年前 0 个赞

无法访问,一般是nginx配置的问题

1.域名是否正常解析

2.nginx配置中,域名是否对应到正确的路径

3.fecshop的配置是否严格按照文档配置

图片404,一般都是nginx没有配置,或者配置错误导致的。(图片是在appimage这个文件目录下)

mixiansheng#25年前 0 个赞

nginx配置是复制的您的,apphtml5和appadmin和appserver都能访问,但是appfront跟图片的域名都访问不了,windows运行网络诊断说已经连接了appfront,但是未对连接做出响应?

mixiansheng#35年前 0 个赞

点击检查代理以及防火墙 报错不能加载本地资源

mixiansheng#45年前 0 个赞

域名

mixiansheng#55年前 0 个赞

Fecmall#65年前 0 个赞

1.tracejs.fecshop.com 这个是追踪js的部分,将这个关闭就可以

我发版的时候忘记默认关掉了

打开文件:@common/config/fecshop_local_services/Page.php

'traceJsEnable' => false,

2.其他的图片加载不到,就是nginx设置的问题,要么域名没有解析,要么nginx设置这个域名对应的文件夹不对。

mixiansheng#75年前 0 个赞

还是解决不了nginx配置跟您的一模一样,apphtml5.fecshop.com appadmin.fecshop.com等都能解析,就是图片和appfront.fecshop.com访问不到,nginx设置的域名对应的文件也没问题啊,加载的图片路径都是对的,就是加载不了

Fecmall#85年前 0 个赞

用docker部署的吗?

把你的nginx 配置域名的部分完整的贴一下,这个问题是nginx配置的问题,另外你看看文件是否可读等等,你自己可以解决的

9楼 已删除.

按着您的开发文档一步一步做的,nginx配置我都没动,要是配置不对,为什么appadmin.fecshop.com和apphtml5.fecshop.com可以访问呢,今天又在新的centos7上重新做了一边,还是appfront.fecshop.com和img.fecshop.com,,,img123---没办法访问,我的centos是nat方式上网,电脑是代理服务器上网跟这个有关系吗?整了两三天了找不出哪里有毛病来?您说的哪个文件可读

PhpMyAdmin

server {

listen       80;
server_name my.fecshop.com;
root  /www/web/phpmyadmin;
server_tokens off;
include none.conf;
index index.php index.html index.htm;

access_log /www/web_logs/access.log wwwlogs;

error_log /www/web_logs/error.log notice;

location ~ \.php$ {
	fastcgi_pass   php:9000;
	fastcgi_index  index.php;
	include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
	expires      30d;
}

location ~ .*\.(js|css)?$ {
	expires      12h;
}

}

Appadmin

server {

listen     80  ;
server_name appadmin.fecshop.com;
root  /www/web/fecshop/appadmin/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ \.php$ {
    fastcgi_pass   php:9000;
    fastcgi_index  index.php;
    include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}
location ~ .*\.(js|css)?$ {
    expires      12h;
}

}

AppFront

server {

listen     80  ;
server_name appfront.fecshop.com appfront.fecshop.es;
root  /www/web/fecshop/appfront/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ \.php$ {
    fastcgi_pass   php:9000;
    fastcgi_index  index.php;
    include fcgi.conf;
}

location ~ /sitemap.xml
{
	if ($host  ~ .*appfront.fecshop.es) {
		rewrite ^/sitemap\.xml /sitemap_es.xml last;
	}
}

location /fr/ {
    index index.php;
    if (!-e $request_filename){
        rewrite . /fr/index.php last;
    }
}

location /es/ {
    index index.php;
    if (!-e $request_filename){
        rewrite . /es/index.php last;
    }
}

 location /cn/ {
    index index.php;
    if (!-e $request_filename){
        rewrite . /cn/index.php last;
    }
}

location /de/ {
    index index.php;
    if (!-e $request_filename){
        rewrite . /de/index.php last;
    }
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

location ~ .*\.(js|css)?$ {
    expires      12h;
}

}

AppHtml5

server {

listen     80  ;
server_name apphtml5.fecshop.com apphtml5.fecshop.es;
root  /www/web/fecshop/apphtml5/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ \.php$ {
    fastcgi_pass   php:9000;
    fastcgi_index  index.php;
    include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

location /fr/ {
    index index.php;
    if (!-e $request_filename){
        rewrite . /fr/index.php last;
    }
}
location /es/ {
    index index.php;
    if (!-e $request_filename){
        rewrite . /es/index.php last;
    }
}

location /cn/ {
    index index.php;
    if (!-e $request_filename){
        rewrite . /cn/index.php last;
    }
}

location /de/ {
    index index.php;
    if (!-e $request_filename){
       rewrite . /de/index.php last;
    }
}

location ~ .*\.(js|css)?$ {
    expires      12h;
}
location /api {
    rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
}

}

AppApi

server {

listen     80  ;
server_name appapi.fecshop.com;
root  /www/web/fecshop/appapi/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
location ~ \.php$ {
	fastcgi_pass   php:9000;
	fastcgi_index  index.php;
	include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
	expires 30d;
}

location ~ .*\.(js|css)?$ {
	expires      12h;
}

}

AppServer

server {

listen     80  ;
server_name appserver.fecshop.com;
root  /www/web/fecshop/appserver/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ \.php$ {
    fastcgi_pass   php:9000;
    fastcgi_index  index.php;
    include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

location ~ .*\.(js|css)?$ {
    expires      12h;
}

}

img

server {

listen     80  ;
server_name img.fecshop.com;
root  /www/web/fecshop/appimage/common;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

}

img2

server {

listen     80  ;
server_name img2.fecshop.com;
root  /www/web/fecshop/appimage/appadmin;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

}

img3

server {

listen     80  ;
server_name img3.fecshop.com;
root  /www/web/fecshop/appimage/appfront;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

}

img4

server {

listen     80  ;
server_name img4.fecshop.com;
root  /www/web/fecshop/appimage/apphtml5;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

}

img5

server {

listen     80  ;
server_name img5.fecshop.com;
root  /www/web/fecshop/appimage/appserver;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

}

VUE

server {

listen     80;
server_name vue.fecshop.com;
root  /www/web/vue_fecshop_appserver/dist ;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /www/web_logs/access.log wwwlogs;
error_log  /www/web_logs/error.log  notice;

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

location ~ .*\.(js|css)?$ {
    expires      12h;
}

}

Fecmall#115年前 0 个赞

1.请使用markdown格式写

2.

server_name img4.fecshop.com;
root  /www/web/fecshop/appimage/apphtml5;

去你的 ./app/fecshop/appimage/apphtml5/custom (宿主主机)路径下查看是否有文件 home_img_1.jpg 等文件

3.docker安装有一个步骤是: 修改配置,然后将修改后的文件复制到./app/fecshop 下面,仔细检查这个步骤,估计你没有复制过去文件

该说的都说完了,自己思考解决吧。

有这个文件,复制过去了??我再想想,谢谢您的帮助

Fecmall#135年前 0 个赞

单独访问这个图片,看看能不能访问,只能提示你可能出问题的点,解决问题还是靠你自己

您自己解决吧

单独访问访问不了的,跟访问appfront.fecshop.com一样,现在不知道哪里出问题了,没有解决的方向了

解决了老师,hosts的问题,开始直接复制粘贴您的配置,注定拿来主义是不行的,把域名后面的注释(#号)后面的去掉就行了,教训深刻,要自己敲代码,非常感谢老师指导,就是域名解析出现了问题,但是hosts域名后注释为什么不起作用啊????感谢老师

Fecmall#165年前 0 个赞

@mixiansheng #15楼

不明白,可以说的更详细一点吗?

把windows里的hosts文件的C:\Windows\System32\drivers\etc\hosts 注释去了就行了,是不是 复制粘贴您的里面的#号有中文的,我这么怀疑的

Fecmall#185年前 0 个赞

恩,后面是注释,可能win 和linux 对待有差异,最好去掉。

文档更新一下

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics