3

I've got a node express app running on AWS EB. I'm serving static assets via nginx rather than via the express and want to set the cache control headers.

I think the answer lies in extending the nginx configuration via an ebextension file but the examples I've tried have all ended up in crashing my environment :-(

Please can someone help me with a working version :-)

Here is is the latest ebextension I tried which from everything I have read should work but causes the environment to crash...

files: /etc/nginx/conf.d/02_cache.conf: mode: "000644" owner: root group: root content: | location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires 30d; add_header Pragma public; add_header Cache-Control "public"; }

user1803975
  • 345
  • 1
  • 4
  • 14
  • Hi can you please try adding double quotes for your filename ? Like this "/etc/nginx/conf.d/02_cache.conf" – Sandun Mar 17 '21 at 05:19

0 Answers0