Where is nginx.conf


(Susan Spencer) #1

Hi everyone,

I need to find the nginx conf file to fix a problem where clicking on the download icon displays text file contents in a new browser tab. A possible solution is to configure nginx specifically that text files should be downloaded, per this article, but I can’t find the nginx.conf file. Our discourse/docker/nginx install is uptodate.

thanks for your time!


(Felix Freiberger) #2

You cannot edit nginx.conf directly as your changes would be overwritten when the container is rebuilt. Instead, you need to use pups syntax to have the file edited during bootstrapping. If you need an example, have a look at this template which inserts rate limiting code into nginx.conf. :slight_smile:

(If you still want to access the configuration file for reading or testing, it’s inside the container in /etc/nginx/conf.d/discourse.conf. Remember that any changes will be lost during the next rebuild – you’ve been warned!)


Show Latest Posts on mobile view
Cannot Load App - when passing a long string to "/new-topic?" API
(Susan Spencer) #3

Thanks @fefrei!

Does this require a new file or an edit to an existing file?
If a new file, what’s the file name, which directory?
If existing, which file, which directory?


(Felix Freiberger) #4

If I’m not mistaken, you can add such replace rules directly to the run block in your app.yml in /var/discourse/containers/app.yml :slight_smile:


(Jay Pfaffman) #5

You can ./launcher enter app and then find stuff in /etc/nginx as you expect, but as mentioned, those changes will get blown away when you rebuild. You can go an test out what you want to do inside the container, and then add the pups code to make those changes when you rebuild.


(Joshua Rosenfeld) #6

This is a known bug we plan to fix. Simply waiting a few days should resolve this for you. See (specifically post 19):