title: Commands in .ebextensions fails on ElasticBeanstalk
body: <p>I'm trying to deploy my Node.js application to AWS ElasticBeanstalk with AWS CodePipeline. Since my application is using WebSockets, I included the following config file in <code>.ebextensions</code>.</p>
  
  <pre><code>container_commands:
    enable_websocket:
      command: 
        sed -i '/\s*proxy_set_header\s*Connection/c \
                proxy_set_header Upgrade $http_upgrade;\
                proxy_set_header Connection "upgrade";\
            ' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
  </code></pre>
  
  <p>However, the CodePipeline fails on the deployment process and the ElasticBeanstalk log file <code>cfn-init.log</code> says follows:</p>
  
  <pre><code>2020-06-18 12:43:42,345 [INFO] -----------------------Starting build-----------------------
  2020-06-18 12:43:42,352 [INFO] Running configSets: Infra-EmbeddedPostBuild
  2020-06-18 12:43:42,355 [INFO] Running configSet Infra-EmbeddedPostBuild
  2020-06-18 12:43:42,359 [INFO] Running config postbuild_0_drcha
  2020-06-18 12:43:42,381 [ERROR] Command enable_websockets (sed -i '/\s*proxy_set_header\s*Connection/c \
          proxy_set_header Upgrade $http_upgrade;\
          proxy_set_header Connection "upgrade";\
          ' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf) failed
  2020-06-18 12:43:42,381 [ERROR] Error encountered during build of postbuild_0_drcha: Command enable_websockets failed
  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
      CloudFormationCarpenter(config, self._auth_config).build(worklog)
    File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
      changes['commands'] = CommandTool().apply(self._config.commands)
    File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
      raise ToolError(u"Command %s failed" % name)
  ToolError: Command enable_websockets failed
  2020-06-18 12:43:42,383 [ERROR] -----------------------BUILD FAILED!------------------------
  2020-06-18 12:43:42,383 [ERROR] Unhandled exception during build: Command enable_websockets failed
  Traceback (most recent call last):
    File "/opt/aws/bin/cfn-init", line 171, in &lt;module&gt;
      worklog.build(metadata, configSets)
    File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 129, in build
      Contractor(metadata).build(configSets, self)
    File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 530, in build
      self.run_config(config, worklog)
    File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
      CloudFormationCarpenter(config, self._auth_config).build(worklog)
    File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
      changes['commands'] = CommandTool().apply(self._config.commands)
    File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
      raise ToolError(u"Command %s failed" % name)
  ToolError: Command enable_websockets failed
  </code></pre>
  
  <p>What is the reason for the failure?</p>