How to customize Nginx document root in AWS Elastic Beanstalk without rewrite whole config?

17 views Asked by At

I need to customize the Nginx document root into AWS Beanstalk. I understand that I can provide a custom Nginx config file. But I'd like to override just the document root. When I'm trying to add 'root' directive into my .platform/nginx/conf.d/elasticbeanstalk/nginx_customization.conf, like this:

 root /var/app/current/public;

 location / {
   try_files $uri $uri/ /index.php?$query_string;
 }

I'm getting "nginx: [emerg] "root" directive is duplicate in /var/proxy/staging/nginx/conf.d/elasticbeanstalk/php.conf" error. So I'm curious if it's possible to customize document root without providing the whole nginx.conf?

0

There are 0 answers