title: Nginx config file overwritten during Elastic Beanstalk deployment?
body: <p>I need to add p3p headers to the static resource location on a standard Nodejs &amp; Nginx Elastic Beanstalk.</p>
  <p>I've created an <code>ebextension</code> script as explained on <a href="https://stackoverflow.com/questions/21335575/how-to-configure-ebextensions-for-nginx-location-directive/21336573#21336573">this question</a>. The script uses set to add a <code>add_header</code> directive under the <code>alias</code> line, which is under the static location directive. It runs on the <code>/etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf</code> file.</p>
  <p>The script not only modifies the file, it also copies it to a &quot;safe&quot; location, i.e. /home/ec2-user. According to <code>/var/log/cfn-init.log</code>, the script runs correctly. As evidence, the copy of the modified file shows the additional header at the right place. But the <code>/etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf</code> file <strong>does not have this modification</strong>.</p>
  <p>I can only deduce that although my script runs fine, something else later in the deployment process overwrites it. Which is strange, because <a href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands" rel="nofollow noreferrer">according to documentation</a> container commands are run after the application and web server have been set up, so I don't see what does it.</p>
  <p>So ho/what is overwriting this file and how can I prevent that?</p>