The beanstalk documentation is not clear on how and what is best way to customize nginx configuration when deploying PHP applications.
I've tried multiple things as include a file /etc/nginx/conf.d/01-security.conf like this:
files:
/etc/nginx/conf.d/01-security.conf:
mode: “000644”
owner: root
group: root
content: |
add_header X-Frame-Options "SAMEORIGIN" always ;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
always;
add_header X-Cache-Status $upstream_cache_status;
I've tried other alternatives but none of them seems to be working. I am a bit confused as beanstalk doesn't give any clear direction on how that should be done for PHP? I've seen people using different strategies, some of them back in 2018, 2017...
I can replace the configuration using container_commands and then restart nginx, but there is any way where I can add more configuration files or modify the original one?