Ngnix config is not retained after rebuild

I have to modify the default nginx config. But, after a rebuild, the modifications are not retained. Does anyone have a solution for this?
And what’s the differents between etc/nginx/conf.d/discourse.conf and etc/nginx/nginx.conf?

You could make a template for your alterations and then include it in your app.yml. For example this SSL template rewrites some parts of the nginx config to support SSL.

1 Like

Yes, thanks very much. This should work. But I have no idea the format the file. What does “from: /listen 80;\s+gzip on;/m” means?

Take a look at the documentation of pups: https://github.com/samsaffron/pups

1 Like

Thanks, another question: what’s the differents between etc/nginx/conf.d/discourse.conf and etc/nginx/nginx.conf?

What are you modifying it to do? I’m asking because there might be another way to achieve the same result.

Because I use AWS cloud front as the CDN. But it grasps the files with http1.0, it get the original files instead of the gzips because the default http version to get gzip is 1.1. So I want to modified the ngnix configuration from http1,1 to http1.0