Score:0

NGINX https not working after I set it up?

in flag

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 :)

Michael Hampton avatar
cz flag
Check the error log.
in flag
I just fixed it, haha! Check the answer below.
Score:0
in flag

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.

djdomi avatar
za flag
Any Admin Panel modified Servers are out of scope on Serverfault jfyi
in flag
I know but I could use SSH.
djdomi avatar
za flag
this does not matter in any way ;)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.