Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
nginx配置允许单个域名跨域访问Access-Control-Allow-Origin
Apps Section
812
views ·
0
replies ·
To
floor
Go
张强890627
deepin
2020-04-14 03:12
Author
大家好:
在本地测试了下前后端分离的配置方法,下面记录了些测试结果(网上找了些没成功)。
测试环境:
firefox:70.0.1
chrome:78.0.3904.97
nginx:1.16.1
vue:2.x
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Origin http://localhost:8080;
add_header Access-Control-Allow-Origin http://localhost:*;
add_header Access-Control-Allow-Origin http://localhost;
add_header Access-Control-Allow-Origin localhost:8080;
add_header Access-Control-Allow-Origin localhost
Copy the Code
以空行为界,上面的配置可行(第一行允许所有、第二行允许单个)、下面不行。
Reply
Like 0
Favorite
View the author
All Replies
No replies yet
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
WiFi Drivers
Popular Events
More
在本地测试了下前后端分离的配置方法,下面记录了些测试结果(网上找了些没成功)。
测试环境:
firefox:70.0.1
chrome:78.0.3904.97
nginx:1.16.1
vue:2.x