0

I'm trying to add two simple things to nginx.conf which work fine until I deploy a new version on ELB, which is expected, so I know I need to use .ebextensions to do this but I either get an error saying "null values are not allowed in templates" or it just doesn't work.

This is my file which is in /.ebextensions/custom.config

files: 
    "/etc/nginx/conf.d/000_my_config.conf": 
    content: |
        client_max_body_size 100M;
        server {
            location / {
                index index.php index.html index.htm;
                try_files $uri $uri/ /index.php?$args;
            }
        }

Simply trying to change the max upload size and adding the location info in to work with Wordpress

S.Pearson
  • 123
  • 1
  • 1
  • 9

1 Answers1

0

There are indentation issues. it should be (note content):

files: 
    "/etc/nginx/conf.d/000_my_config.conf": 
        content: |
            client_max_body_size 100M;
            server {
                location / {
                    index index.php index.html index.htm;
                    try_files $uri $uri/ /index.php?$args;
                }
            }

For form of the files, check here.

There could be other reasons why it fails, can't tell from the short question. But the indentation is definitely one of the reasons you have problems though.

Marcin
  • 215,873
  • 14
  • 235
  • 294