Back

[SOLVED] How to enabled SSL in an ubuntu 22.04 server with Nginx

  • 0
  • Self Hosted
darwinmorocho
28 Apr, 2024, 03:34

I have my Ubuntu server where I have some Node.js projects running with PM2 and Nginx as a reverse proxy. These projects have SSL with Certbot.

I have installed Docker and Appwrite. Since ports 80 and 443 are used by Nginx and Certbot, I have selected ports 81 and 4433 for Appwrite. Then, I followed the documentation provided at https://appwrite.io/docs/advanced/self-hosting/tls-certificates, but I am unable to run my Appwrite instance with SSL.

TL;DR
To enable SSL in an Ubuntu 22.04 server with Nginx for Appwrite: - Define Nginx configuration file in `/etc/nginx/sites-available` - Update proxy_pass to use `https` for Appwrite - Run `sudo certbot --nginx` for SSL - Proxy other apps through Nginx with SSL - Use Nginx to handle SSL certificates - Make sure to proxy to Appwrite using `https` on the correct port (4433 in this case) - Follow the provided documentation for Appwrite TLS certificates Solution: Run `sudo certbot --nginx` for Appwrite instance with
Steven
28 Apr, 2024, 03:36

You can do the same with the other projects and use nginx to handle the SSL certificates.

Just make sure to proxy to Appwrite using https on the https port

darwinmorocho
28 Apr, 2024, 03:37

Hi Steven. Could you give some example or some link to check a guide?

Steven
28 Apr, 2024, 03:45

But how did you generate the certs for your other apps? How did you proxy your other apps? It's the same thing

darwinmorocho
28 Apr, 2024, 03:49

I have defined the next file into /etc/nginx/sites-available

TypeScript
server {
    server_name app.codergym.fit;

    location / {
        proxy_pass http://localhost:81;
    }
}

And running sudo certbot --nginx ssl now it is working for my appwrite instance. For functions will be the same process?

Steven
28 Apr, 2024, 03:50

So you're proxying via http, but for Appwrite, it should be https

Steven
28 Apr, 2024, 03:50

Yes, functions will be the same

darwinmorocho
28 Apr, 2024, 03:59

@Steven Thanks for your support .

darwinmorocho
28 Apr, 2024, 03:59

[SOLVED] How to enabled SSL in an ubuntu 22.04 server with Nginx

darwinmorocho
28 Apr, 2024, 04:00

[CLOSED] How to enabled SSL in an ubuntu 22.04 server with Nginx

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more