Ngnix config is not retained after rebuild


(徐徐浩) #1

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?


#2

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.


(徐徐浩) #3

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?


(Gerhard Schlager) #4

Take a look at the documentation of pups: GitHub - discourse/pups: Simple yaml based bootstrapper for Linux machines


(徐徐浩) #5

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


(Robin Ward) #6

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


(徐徐浩) #7

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