server {
listen 80;
server_name *************.com;
location / {
proxy_pass http://192.168.1.114:36980;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
查看浏览器请求记录:/actuator/globalinfo 用域名请求不到,用ip可以;
页面报错信息:
{
"message": "Network Error",
"name": "AxiosError",
"stack": "AxiosError: Network Error\n at v.onerror (http://test-en.lanbiostats.com/console/assets/axios/axios.0131feff.js:1:37163)\n at e.<anonymous> (http://test-en.lanbiostats.com/console/assets/axios/axios.0131feff.js:1:48621)\n at p (http://test-en.lanbiostats.com/console/assets/axios/axios.0131feff.js:1:3448)\n at Generator.<anonymous> (http://test-en.lanbiostats.com/console/assets/axios/axios.0131feff.js:1:4779)\n at Generator.throw (http://test-en.lanbiostats.com/console/assets/axios/axios.0131feff.js:1:3858)\n at p (http://test-en.lanbiostats.com/console/assets/axios/axios.0131feff.js:1:9996)\n at u (http://test-en.lanbiostats.com/console/assets/axios/axios.0131feff.js:1:10235)",
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"adapter": [
"xhr",
"http",
"fetch"
],
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, /"
},
"withCredentials": true,
"method": "get",
"url": "/actuator/globalinfo"
},
"code": "ERR_NETWORK"
}