[SOLVED] Not able to setup https connection with Appwrite running behind Nginx
- 0
- Self Hosted
- Tools
- General
hey Hope you all are doing well. Appwrite is now has become my favorite backend . I was tired of high pricings of Firebase so I decided to self host Appwrite on my own server. It was a good experience that everything is well documented and I was able to self host Appwrite very easily. During the process the only problem that I faced was SSl and serving Appwrite behind my Nginx Proxy Server. Please clear my doubts regarding: 1. I want to run my Appwrite on a different ports say 5696 for http and 5697 for SSL. It works fine when with http but not worked with https. and here is my Nginx Config file
listen 80;
server_name example.com www.example.com;
location / {
proxy_pass http://example.com:5696;
proxy_http_version 1.1;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}``` What should I do to make it able to serve on https and http as well. All of your kind and valuable suggestions are welcome.
Maybe you need another one of these but for port 443 and 5697?
@Steven thank for your valuable time I did Try alot but not finding a way to get a legit work around.
Also I'm not sure if you need the server port in that host header
What did you put for the other nginx config? What's the problem?
Currently i am having only this config file. filehttps://discord.com/channels/564160730845151244/1142432370104991834/1142432370104991834
And with this i am not able to open up my Apwrite console with https.but when with the same file i set the default ports of appwrite as 80 as 443 then everything works fine. And when i change my ports to anyother value then they work only for http not for https part.
Well this is port 80 so of course port 443 won't work π§
Sorry i did not get your point may you elaborate it.
You have listen 80 here. That means nginx is listening for http traffic and then will forward to Appwrite. I'm not that great with nginx, but I'm pretty sure you need another config similar to this but with listen 443
Yep i have tried that one too, i tried using certboot with let's encrypt generated ssl certificate as well while listening 443 with nginx but that also failed too. At the moment I am trying some more fixes and will let you know more about it with in next hours.
@Steven I am curious to know about the fact that when we change default port 80 to amyother value, our apwrite console run smoothly on http. But when we change ssl port 443 to amy other it shows 404 page not found. Can't we make some default changes in traefik so that it can handle ssl/https on any other port as well just like it handles http request even when default postt 80 has changed to some other value? Is there a way?
I'm not really sure what you mean. You can have Appwrite exposed on any port you want. What exactly did you change to change Appwrite's ports?
@Steven i just have solved this and now its working amazingly behind nginx proxy
I will share the solution what i did.
Attavhing complete solution with in a few minutes
@ZiaChoudhary looking forward:)
Solution Please read the guide and follow all the steps carefully. If you find any issues do contact
https://medium.com/@zia-ch/how-to-run-appwrite-with-nginx-professionally-5ba420789ef0
[SOLVED] Not able to setup https connection with Appwrite running behind Nginx
Recommended threads
- Appwriter Linux Key Bindings
Any tips for configuring appwriter for ubuntu? Actually the keybindings are tightly binded to either windows or mac. Working well on windows but in ubuntu some ...
- Custom Domains
Hi All, Should be a quick config issue. I'm setting up custom domains on the hosted version. I have verified the domain with the CNAME but appwrite isn't gene...
- Unauthorized Charge After Appwrite Pro F...
I was using Appwrite Pro credits worth $100, which were valid until November. During this period, I was exploring Appwrite's services. However, I recently notic...