Where to put custom content?

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

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

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.

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

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.

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.

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.

3 Likes

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.

3 Likes

Unsure if I should begin a new topic, or add to this existing one, for this basically identical question.

On a self-hosted install, following discourse/INSTALL-cloud.md at master · discourse/discourse · GitHub, I’m curious if there’s a sanctioned method for the discourse container’s Nginx server to serve up a directory outside of the container, one passed to the container, like the /var/discourse/shared/standalone directory, or even from within that directory.

In particular, I’d like to play with https://github.com/digitallinguistics/app without setting up a subdomain, with an eye toward building a plugin for discourse that uses this language tool.