rewriting cors header in proxy
This commit is contained in:
parent
2c9487c748
commit
8cd8a5ab4d
|
@ -14,7 +14,7 @@ Response: <span id="response"></span>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'http://192.168.2.214:3000/',
|
url: 'http://localhost:8080/service',
|
||||||
success: res => {
|
success: res => {
|
||||||
$('#response').text(res);
|
$('#response').text(res);
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,5 +8,7 @@ server {
|
||||||
|
|
||||||
location /service {
|
location /service {
|
||||||
proxy_pass http://192.168.2.214:3000/;
|
proxy_pass http://192.168.2.214:3000/;
|
||||||
|
proxy_hide_header Access-Control-Allow-Origin;
|
||||||
|
add_header Access-Control-Allow-Origin $http_origin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue