Where to put custom content?


(Reg Natarajan) #1

Hello, I have a new Discourse forum up and I’d like to do some customizing. Very specifically, I’d like to create a directory in which I can put some stuff and I’ll take it from there. If my forum is at http://someforum.com, I’d like to create http://someforum.com/somecustomstuff.

I’m new to containers and Nginx. I was hoping to skip them and go serverless but here I am. Any help would be appreciated.

Reg


(Felix Freiberger) #2

Does it have to be a subdirectory? It will be a lot esier to use a subdomain instead.


(Reg Natarajan) #3

Yes, unfortunately it does because I can’t do a Jquery reload of HTML content from a different domain. It’s considered a security risk and Jquery fails if you try it.


(Reg Natarajan) #4

I found the uploads directory in /var/discourse/shared/standalone/ so I tried creating /var/discourse/shared/standalone/somecustomcontent, but I couldn’t access it at https://somedomain/somecustomcontent


(Felix Freiberger) #5

What’s that?

You should probably describe what you want to do in a lot more detail – because of the way Discourse is designed, what you want to do may not work as you expect.


(Reg Natarajan) #6

I don’t think more detail is needed. I really just want to be able to have a subdirectory in my website where I put stuff. It doesn’t matter if it’s an image or an html page or anything else. I want to go to http://mydiscourseforum.com/mycustomstuff/myfile.html. Surely this is possible somehow.


(Felix Freiberger) #7

I do think so.

Do you want users to be able to click links from Discourse to these new sites? If you do, you’ll need to use a subdomain, move Discourse to a subfolder or manually patch up the client-side routing for these links to work.


(Michael Friedrich) #8

I don’t think that the Nginx server inside the Docker container will automatically do that. In my setup, an Nginx server is running on the server as proxy talking to Discourse via Unix socket. The configuration includes a shared directory for custom served images, like logos used in the footer and other content.

Example:

    # Custom static images
    location /static/images/ {
        alias /var/discourse/shared/static/images/;
    }

The entire setup is documented here. This follows the setup explained here.