Subdomain redirect to path

#1

Hi,

I’m trying to update nginx to permanently redirect from a subdomain.domain.com to domain.com/subdomain. Based nginx best practices, it looks like I should add a new server block with a return statement. Based on how Discourse works with Digital Ocean, it looks like I want to make the change in containers/app.yml. I’ve made other smaller changes by using replace, but in this case I want to add an entire server block. What’s the best way to accomplish this?

Thank you.

0 Likes

(Joshua Rosenfeld) #2

We strongly recommend against a subfolder install, it add significant complexity for limited (if any) benefit. If you absolutely must have a subfolder, see Subfolder support with Docker.

1 Like

#3

Thanks @jomaxro. We have everything working fine with the subfolder install. It wasn’t too bad thanks to help from this forum and that thread. We just want to redirect 301 from the subdomain to the subfolder url. Maybe I’m missing something but where in that linked thread does it address the redirect?

0 Likes

(Jay Pfaffman) #4

Just do it. It’s the same as the smaller changes you’ve made.

2 Likes