How to serve .xml files directly from /uploads/default/original/

My discourse site is very big and I had created custom sitemaps for my site. The traditional discourse sitemap plugin is crashing because the topics query is too big and is timing out for my Database. It is exceeding all kinds of big resources. Thus i made my own static xml sitemaps. Now i need to upload somewhere to serve.
But discourse only serves images directly uploaded in this folder, not xml. What should I do? Adding xml extension in file upload settings is not helping either.

i want to serve my files as /uploads/default/original/2X/1.xml /uploads/default/original/2X/2.xml like this

I think I would add a section in the nginx config to serve them.

You’d add code in app.yml

1 Like

you mean volume ? can you please explain a little bit. I need it Urgently.

Enter the container and edit /etc/nginx/conf.d/discourse.conf to have it serve files from /sitemap. You can Google nginx for help on how you might do that.

You can get nginx to reload the config with

  sv restart nginx

That will solve your immediate problem. The you can go about making changes to app.yml that will make those changes when you rebuild the container.

If that doesn’t make sense and it’s urgent and you have a budget my contact info is in my profile.

1 Like