0

I have hosted my JavaScript application in aws ec2 server. I'm using centos 7 and placed my JavaScript static files in /usr/share/nginx/html directory. I'm using nginx as reverse proxy.I have one yaml file inside this JavaScript files that is accessible through the browser. The yaml file contains all the sensitive information but that file is necessary to load my application. Is there any way to disable direct access to that file in browser. Or is there any way to disable that information disclosure in browser through nginx.Thanks in advance for the help.

I have tried

 location /properties.yaml {
rewrite ^/$ /login.html permanent;
}

But this is not working. Then i tried to read that file from other location like

location /properties.yaml{
try_files $uri /var/www/html/properties.yaml;
}

Could you please guide.

Vijay
  • 13
  • 4

0 Answers0