mixiansheng

第 792 位会员

会员
个人信息
  • 加入于 2019-01-07 13:58:23
  • 最后登录时间 5年前
个人成就
  • 发表文章次数 1
  • 发布回复次数 15
  • 个人主页浏览次数 1
使用vue前后端分离,跨域问题求解。求大佬看看我的配置有问题吗,感谢!!5年前

config/dev.env.js这个文件website_root,用localhost:8080 API_ROOT: '"//appserver.fecshop.com"', WEBSITE_ROOT: '"//localhost:8080"' 这里的也用http://localhost:8080 吗 要是把vue的域名本地做域名host映射,譬如域名是fecvue.com,在hosts里"127.0.0.1 fecvue.com"这么写,访问的时候fecvue.com:8080,这么访问吗??在@appserver/config/fecshop_local_services/Helper.php文件, 将'Origin' => ['http://fecvue.com:8080'],这样吗?在@appserver/config/fecshop_local_service/Store.php// store key:域名去掉http部分,作为key,,,,fecvue.com:8080,这样吗???新手请大神解答

使用vue前后端分离,跨域问题求解。求大佬看看我的配置有问题吗,感谢!!5年前

我也遇到同样的问题,只能把appserver\web\index.php 这几行注释去掉了 可以访问了 加上注释就不行

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

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

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

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

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

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

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

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

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

按着您的开发文档一步一步做的,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;
}

}

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

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

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

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

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

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

Your Site Analytics