Hi I am trying to create an angular proxy. The current setup directs or route traffic from the landing page to the backend services and I am using the following documentation from angular site: https://angular.io/guide/build#proxying-to-a-backend-server. I am using the proxy.conf.js since I have to route traffic to different paths. Currently seeing the following error:
Access to XMLHttpRequest at 'https://backend-service.customdomain.net/security/v1/users/signon' from origin 'https://10.10.10.4' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.
My proxy.conf.js looks like this
proxy.conf.js
const PROXY_CONFIG = [
{
context: [
"/admin",
"/security",
"/event-log",
"/converter"
],
target: "https://backend-service.customdomain.net",
secure: false,
changeOrigin: true,
logLevel: "debug",
headers: {"Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "*", "Access-Control-Allow-Methods": "POST, GET, PUT, OPTIONS, DELETE", 'X-Requested-With' :'XMLHttpRequest'},
}
]
module.exports = PROXY_CONFIG;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…