4

I'm new to AWS EBS. I'm trying to modify etc/nginx/nginx.conf. I just wanted to add a line in http{ underscores_in_headers on; } and I'm able to change by accessing the instance with IP using putty. But the problem is that when auto scaling scales the environment with new IP then the line http{ underscores_in_headers on; } will be removed from new instance.

So, I want when server deploy new snapshot/instance has to be similar as the main server or you can say with same configuration.

I tried to solve my issue with this link

6
  • 2
    Have you already seen this? docs.aws.amazon.com/elasticbeanstalk/latest/dg/… Commented Aug 9, 2018 at 13:02
  • 1
    yes, i have seen this but I'm not able to understand. How I have to do this. Commented Aug 9, 2018 at 13:07
  • I understand that I need to add configuration file in .ebextensions but not able what I have to add to this file. Commented Aug 9, 2018 at 13:09
  • 1
    You can check the nginx directives here: nginx.org/en/docs/http/…. You should be able to add the underscores_in_headers option to the server directive that's in the example, or just create a top-level http directive. Commented Aug 9, 2018 at 13:16
  • while updating the EBS it is giving error Top level element in configuration file .ebextensions/nginx/nginx.config in application version app-2244-180809_185240 must be a map. Update the top level element in the configuration file. 2018-08-09 13:22:54 ERROR Failed to deploy application. Commented Aug 9, 2018 at 13:24

2 Answers 2

1

Step 1 To edit the configuration in AWS ElasticBean of nginx you need to add the configuration file in .ebextensions

to this add folder .ebextensions/nginx/ create proxy.config file

files:
  /etc/nginx/conf.d/proxy.conf:
    mode: "000644"
    owner: root
    group: root
    content: |
      underscores_in_headers on;

it will start accepting header with underscores.

Step 2

In case if it not accepting header with underscores then access your instance with ssh and run the following command.

sudo service nginx reload

Hope it helps.

Sign up to request clarification or add additional context in comments.

Comments

0

stack isn't letting me comment because I'm a noobie. Prateek really helped out, just one small modification to his solution for the proxy.config file and it should work! Don't forget to indent /etc/nginx/conf.d/proxy.conf: as well! Further info here: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/nodejs-platform-proxy.html

files:
  /etc/nginx/conf.d/proxy.conf:
    mode: "000644"
    owner: root
    group: root
    content: |
      underscores_in_headers on;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.