0

I solved it, see my answer below!

So I just used certbot to generate an nginx certificate however https:// on my domain doesn't work. It gives me a 403 forbidden error.

SSL Configuration:

server { 
      listen 443 ssl; 
      ssl on; 
      ssl_certificate /etc/letsencrypt/live/[domain].xyz/cert.pem; 
      ssl_certificate_key /etc/letsencrypt/live/[censored].xyz/privkey.pem; 
      root /gopanel/sites/[doooomaiiiin cennnsoooored]/public; 
      index index.php index.html index.htm; 
      server_name [ehehehe C E N S O R E D].xyz; 


    location / {
        proxy_pass https://localhost;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Any ideas why? Tell me if you need the http configuration. I really don't know how to figure this one out.

NOTE

I am using Node.JS and the Express.JS app is on port 8080 :)

SirStopIt
  • 1
  • 1

1 Answers1

0

I fixed it.

I am actually on macOS using an app called goPanel 2 that helps with configuring stuff like nginx, apache and stuff (it has a UI which makes it easy)

Turns out, I shouldn't use goPanel 2 for adding the SSL, I should of actually SSH'd into it using my Terminal and manually adding it instead of using goPanel 2.

So I typed in sudo certbot --nginx -d my-domain.xyz -d www.my-domain.xyz and well, it worked!

Now I know I should do it manually instead of using goPanel 2 to do it. Silly me.

SirStopIt
  • 1
  • 1