How can I access NGINX? (digital ocean one-click install)

(Bryan Holst) #1

I am running Discourse from the one-click install on DigitalOcean. I noticed that I cannot locate NGINX via ftp… I’m quite certain that I’m missing something super obvious, but I sure don’t know what it is. :stuck_out_tongue_closed_eyes:

Any help is appreciated!! Thanks in advance.

(Mittineague) #2

Which one-click install guide did you follow? I know there was an older one that had problems, but hopefully this not so new but more recent guide is up to date.

(Jay Pfaffman) #3

It’s very likely that what you are trying to do won’t do what you want it to. The nginx files are inside the container. Stuff that’s in /var/discourse/shared/standalone is accessible from inside and outside the container, so that sort of answers your question, but it probably won’t help.

Let’s pretend that you knew where the NGINX files were, what would you do then?

(Bryan Holst) #4

Maybe I should’ve worded my question better. Basically, I had someone helping me with htaccess (I’m needing to redirect some URL’s) and he said that what he needs to do is done where NGINX is located. I hope this makes sense, because it barely makes sense to me. My strength is not in the Linux world :stuck_out_tongue:

(Felix Freiberger) #5

.htaccess files won’t work with NGINX. What are you trying to do, exactly? Maybe /admin/customize/permalinks will be enough for your needs :slight_smile:

(Bryan Holst) #6

Unfortunately, I don’t even see the /admin/… folder. I’m guessing that is due to the one-click installation. Attached is a screenshot of the folders that I can see…

Basically, the end result that I’m after is this…
I started a discourse forum recently that is a spinoff from an old existing forum that is no longer being maintained. Before he moved on, he forwarded all threads to point to a thread that he created on my discourse forum that explains that he moved on, etc. However, in the process of forwarding, he screwed something up (and can no longer be contacted :frowning: ). The URLs are forwarding as follows:

Linked from

Now goes to

This is not a valid URL. Basically it is tagging on all the path from the old forum and attaching it to the end of what would’ve been the correct path.

I’m hoping to set it up so that anything after /397/… goes back to the following:

I don’t know if this is done via permalinks, htaccess, or whatever… Either way, it seems that my access to certain files is limited or hidden. Thanks for any help!!

(Felix Freiberger) #7

This should be doable with permalinks. Open your Discourse instance (in a Browser), open the hamburger menu, click “Admin”, “Customizations”, “Permalinks”. I’m pretty sure you can use regular expressions there (but cannot check right now).

(Bryan Holst) #8

Thank you! Looks like you’re on to something, but how can I best set that up? I’m trying to re-direct anything that gets placed after the “/397/” in the URL to go back to that thread (397)… I tried a number of things including placing an “*” after the path, but it didn’t like that. (ie,*

Any way to do this without doing this to every single bad link? There are 120,000+ bad links at this point. haha!

(Felix Freiberger) #9

It looks like I’m wrong and these permalinks don’t support regular expressions – so you’ll probably have to amend nginx’s configuration instead. This has to be done by adding a corresponding rule to your app.yml and rebuilding, but that’s outside of my area of expertise :frowning:

(Jay Pfaffman) #10

But there is permalink redirects which do support regular expressions for just this use case.

(Jay Pfaffman) #11

You need to fix the https cert for or this conversation is moot as nothing will go there to get redirected anyway.

If you mean that every single post on his site points to that one post, I think you want to create this permalink normalization


And he bolted, but left his old forum running? What you really want is a dump of his database and then you could import them into your forum.

(Bryan Holst) #12

Yes. I definitely need a hand with that too.

I’ll give this a try. Thanks!

That is correct. And I’d LOVE a dump of that database. That would’ve been a huge help, but he bailed directly after he created that post unfortunately. Hopefully I can figure out a way to get in touch with him again as it’d be nice to get that still.

(Sam Saffron) #13