Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Added "Appwrite using NGINX as Reverse Proxy" resource #474

Closed
wants to merge 1 commit into from

Conversation

WilfredAlmeida
Copy link
Contributor

Added blog resource on how to deploy Appwrite on VPS server using NGINX as a reverse proxy

Added blog resource on how to deploy Appwrite on VPS server using NGINX as reverse proxy
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this PR! 🙏🏼 The content is very detailed and helpful!

Some things are missing, though.

  1. Enabling SSL is very important, and it's best to have HTTPS traffic routed to Appwrite's HTTPS port. Missing that can cause problems with cookies.
  2. Without some additional configuration on the traefik container, Appwrite will detect IPs as the Nginx proxy rather than the actual client (for example, in the audit logs or sessions
  3. The Nginx config is missing some directives for realtime so the realtime API won't work.

@WilfredAlmeida
Copy link
Contributor Author

Thanks for pointing it out. Will update the blog and let you know for further review.

@adityaoberai
Copy link
Member

@WilfredAlmeida were you able to make the requested changes?

@WilfredAlmeida
Copy link
Contributor Author

@stnguyen90 @adityaoberai

Enabling SSL is very important, and it's best to have HTTPS traffic routed to Appwrite's HTTPS port. Missing that can cause problems with cookies.

SSL from client -> server gateway can be enabled using certbot or any desired method.
Can SSL from NGINX to Appwrite on localhost be enabled by routing traffic to the HTTPS port? Like the below NGINX directive change

from
proxy_pass http://localhost:2021;

to
proxy_pass https://localhost:2022;

The Nginx config is missing some directives for realtime so the realtime API won't work.

The NGINX directives you suggested have been added.

I have updated my config as mentioned above and Appwrite loads fine. Will update more on testing its individual functionalities.

Without some additional configuration on the traefik container, Appwrite will detect IPs as the Nginx proxy rather than the actual client (for example, in the audit logs or sessions

I don't quite understand what config changes to do here. I found this blog post however it uses NGINX Proxy Manager. Need more help with this.

@adityaoberai adityaoberai requested a review from stnguyen90 March 27, 2023 16:00
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilfredAlmeida,

  1. Yes, proxy_pass https://localhost:2022; is good.
  2. Yes, the services.traefik.command section is the relevant part. Btw, you should be able to test this by logging in to the console and looking at the activity for your user. The IP Address should show your public IP if it's working correctly.
  3. I don't see the directives for realtime/websockets. Did you test if realtime works?

@adityaoberai
Copy link
Member

@WilfredAlmeida did you get a chance to review the aforementioned points and update your blog?

@WilfredAlmeida
Copy link
Contributor Author

@stnguyen90 @adityaoberai

No, I don't have any project workload yet to test the changes for traefik & realtime directives.

I'm open to some collaboration on this, as to I can provide an Appwrite instance for someone with an existing project to use it and I can make the changes to get all things working, or you can point out the exact things to add in which I can add in directly.

@adityaoberai
Copy link
Member

adityaoberai commented Jun 16, 2023

@WilfredAlmeida, you can take this discussion (collaboration request) to the Appwrite Discord server.
In the meantime, since the collaboration + testing process might take some time, I'll close the PR until you can test the solution and update the blog as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants