Http shows nginx page

Hello! I’ve done the installation from zero.
It was a bit strange, because when I tried ./discourse-setup, I’ve got

Hostname for your Discourse? [oreillefine.art]: 

Checking your domain name . . .
WARNING: Port 443 of computer does not appear to be accessible using hostname:  oreillefine.art.
WARNING: Connection to http://oreillefine.art (port 80) also fails.

Then I manually edited app.yml to add smtp settings and let’s encrypt mail, as well as templates for https usage.

Then I’ve tried ./discourse-doctor and everything worked! I was able to see the new website. But… now I am confused: if I am trying to access my site via http (http://oreillefine.art), I am seeing nginx default page, while https works normally (https://oreillefine.art), and I can see Discourse… many thanks in advance for any help!

I suspect that you got that error because you have some otherr NGINX on your machine that’s keeping Discourse from accessing it.

I don’t understand how it managed to get a cert if that’s the case, though.

I am sure I don’t have any other nginx, it’s a new vps and I didn’t install nginx or apache before… as for different content of http and https, could you suggest any solution?

Hmm. That’s very strange. I have no explanation or recommendations.

probably I can give you some log files?

I saw this during rebuild:

listen 80;
  return 301 https://$$ENV_DISCOURSE_HOSTNAME$request_uri;
}
server {
 in /etc/nginx/conf.d/discourse.conf
I, [2024-05-10T12:24:54.676331 #1]  INFO -- : Replacing (?m-ix:listen 80;\s+gzip on;) with listen 443 ssl http2;
SSL_TEMPLATE_SSL_BLOCK
 in /etc/nginx/conf.d/discourse.conf
I, [2024-05-10T12:24:54.677081 #1]  INFO -- : Replacing (?m-ix:listen 80;\s+listen \[::\]:80;\s+gzip on;) with listen 443 ssl http2;
listen [::]:443 ssl http2;
SSL_TEMPLATE_SSL_BLOCK
 in /etc/nginx/conf.d/discourse.conf
I, [2024-05-10T12:24:54.677779 #1]  INFO -- : Replacing (?-mix:SSL_TEMPLATE_SSL_BLOCK) with 
ssl_protocols TLSv1.2 TLSv1.3;

It looks like it’s redirecting as expected now.

My best guess is that a DNS lag and the hostname used to point to some other server that was running an unconfigured NGINX server.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.