Back

[SOLVED] Digital Ocean Deployment

  • 0
  • Web
naveen
5 Apr, 2023, 16:10

I have created a droplet on digital ocean for appwrite and have and also i have deployed a react application using appwrite in the digital ocean. When i try to access the appwrite it shows the error: The page at 'https://example.com/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://153.246.45.23/v1/account/sessions/email'. This request has been blocked; the content must be served over HTTPS. I think the problem is trying to access http from https. As i see my appwrite is running as not secure. Is there a way to change it to a secure https endpoint?

TL;DR
Solution: To change the endpoint to a secure HTTPS endpoint, follow these steps: 1. Change the value of `_APP_OPTIONS_FORCE_HTTPS` to `enabled` in the `/root/appwrite/.env` file. 2. Run `docker compose down && docker compose up -d` to apply the changes. 3. If you have a domain, set the following values in the `.env` file, where `your-domain.com` is your domain: ```ini _APP_DOMAIN=your-domain.com _APP_DOMAIN_TARGET=your-domain.com ``` 4. Run `docker compose down && docker compose
Binyamin
5 Apr, 2023, 16:20

Yes

Change the value of _APP_OPTIONS_FORCE_HTTPS to enabled inside /root/appwrite/.env

Then run docker compose down && docker compose up -d

Binyamin
5 Apr, 2023, 16:22

If you have domain then the best practice would be to also set this values with your domain in the .env file

TypeScript
_APP_DOMAIN=your-domain.com
_APP_DOMAIN_TARGET=your-domain.com

Then run docker compose down && docker compose up -d again

naveen
5 Apr, 2023, 16:24

Sorry if the doubt is too basic, iam not using docker , iam using digital ocean droplet . Can i change the value of _APP_OPTIONS_FORCE_HTTPS ? and will it work?

Binyamin
5 Apr, 2023, 16:25
naveen
5 Apr, 2023, 16:26

yes

Binyamin
5 Apr, 2023, 16:27

Its the same. it's using Docker & the docker.compse.yml file it just do all the work for you. Installing docker config etc. All of the files are located in /root/appwrite/ So you're able to follow the instructions above

naveen
5 Apr, 2023, 16:30

ok Let me try and get back to you

naveen
5 Apr, 2023, 17:02

Thank you, it worked

Drake
5 Apr, 2023, 17:56

[SOLVED] Digital Ocean Deployment

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