I am building a dictionary application using angular which uses oxford dictionary API to retrieve the data . In the development environment I have used proxy.conf.json to forward the requests.This is my proxy.conf.json file
{
"/oxfordapi": {
"target": "https://od-api.oxforddictionaries.com/api/v1/entries/en/",
"secure": true,
"changeOrigin": true,
"logLevel": "debug",
"headers": {
"Accept": "application/json",
"app_id": "cb35ef20",
"app_key": "603be016c344650e6d8c1da15330f7af"
},
"pathRewrite": {"^/oxfordapi" : ""}
}
}
When I build the application for the production version and host it on my nginx server it always gives error when i try to get data from the server. I have read proxy_pass in nginx server config can be used but I am newbie to nginx server please help me fix this problem. If possible give the full server configuration for this issue .Thanks in advance
server{ root /home/ubuntu/test/dist/demo; index index.html; server_name test.vivekm.me; location / { try_files $uri $uri/ /index.html; } }