proxying address in url param
This commit is contained in:
parent
8cd8a5ab4d
commit
3fabbe0fec
|
@ -14,7 +14,7 @@ Response: <span id="response"></span>
|
|||
<script>
|
||||
$(function() {
|
||||
$.ajax({
|
||||
url: 'http://localhost:8080/service',
|
||||
url: 'http://localhost:8080/service?url=http://192.168.2.214:3000/',
|
||||
success: res => {
|
||||
$('#response').text(res);
|
||||
},
|
||||
|
|
|
@ -3,11 +3,14 @@ server {
|
|||
server_name _;
|
||||
server_name_in_redirect off;
|
||||
|
||||
resolver 127.0.0.11;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log debug;
|
||||
|
||||
location /service {
|
||||
proxy_pass http://192.168.2.214:3000/;
|
||||
proxy_method GET;
|
||||
proxy_pass $arg_url;
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header Access-Control-Allow-Origin $http_origin;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue