Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

博主你好,express监听端口是3000,而vue是80,这样不就是跨域了吗 #10

Open
lixiusen opened this issue Nov 12, 2018 · 1 comment

Comments

@lixiusen
Copy link

No description provided.

@alloyteamzy
Copy link
Owner

alloyteamzy commented Nov 12, 2018

没有哦,服务器我这里配了ssl,所以前端(Vue)端口是443,我请求的接口格式也是类似于https://www.zygg.cc/api/user... 等,也是443端口,所以不存在跨域的哈,至于3000呢,是我express服务是监听的3000端口,每次我请求接口时,我做了一个请求端口转发,不是直接请求3000端口的服务的哦
,所以不存在跨域的说法,如下简单端口转发示例:
location /api { proxy_pass https://120.75.124.126:3000/api; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants