Hi everyone. So I have setup Discourse and configure Cloudflare and SSL connection.
So far so good. Now I see my website is accessible via the domain name and the default ip, which I do not want.
When I use a CMS such as Wordpress or Modx ( on apache ), I normally configure the ht.access to do the trick. But Discourse is not on Apache…
Is there a way to do that with Nginx ? I am not even sure that Discourse uses it.
Anyway that is the code I would be using:
# Tells the browser to always force SSL.
# Do not use this line if there is a chance you will turn off SSL
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
if ($scheme != "https") {
rewrite ^ https://discourse.mydomain.com$request_uri permanent;
}
if ($host != "discourse.mydomain.com") {
rewrite ^ https://discourse.mydomain.com$request_uri permanent;
}
host:port at 123.123.123.123:8080
domain example.com maps to host:port
you don’t want requests for host:port to work, but only requests for the domain that are mapped to the host:port
But that doesn’t make sense to me and the code example you posted isn’t about that so I am confused.
What instructions did you follow for your install and is this a domain name, host IP, or port problem?