My appwrite hosted at https://appwrite-domain.com/ and front-end app hosted at https://app-domain.com/, so both of them use "https". Front-end app use Web SDK and call "createOAuth2Session" with given provider, when I redirected to provider urls of Google or Facebook in "redirect_uri" param I see http://appwrite-domain.com/callback instead of "https".
As described above I used in both "https", so why it passed "http" instead. Can someone explain how Appwrite decide which protocol should be passed into this (attached screenshot from the code source).
P.S. Maybe the reason with "Traefik" which used by Appwrite, before we have a problem with ports, because we need to host both front-end and appwrite with the 80/443 on the same server.
So for that we disabled traefik SSL generation, and transfer hosting to nginx and generate certificates for both of them here.
Can you share your Nginx config, I think you'll need to change it to be also http.
Good Try to change it so the internal revers proxy will go to an https one
location / {
proxy_pass https://appwrite;
...
}
@Binyamin, thanks for answer, I'm haven't direct access to server for changing this configuration, so I will comeback with answer if it helps me later.
Issue was resolved. For any one who stack with problem of nginx proxy to traefik (appwrite built-in), leave a description of problem:
It was in the wrong IP address of host nginx proxy in config of traefik.
services: traefik: image: traefik:2.7 container_name: appwrite-traefik <<: *x-logging command: - --entrypoints.appwrite_web.forwardedHeaders.trustedIPs=172.18.0.1 (here was missmatch)
This setting tells Traefik to trust X-Forwarded-* headers from nginx where IP address and Proto of real incoming connection is stored.
[SOLVED] Redirect URI passed as HTTP not HTTPS via OAuth2
Recommended threads
- 1:1 relationship doesn’t sync after re-a...
Hi, I’m trying to use a two-way one-to-one relationship. It works fine when I create a record with the relationship set, and it also works when I unset it. But ...
- Failed to create function
Hey everyone 👋 I'm having an issue creating Functions on Appwrite Cloud and I'm not sure if it's a platform bug or something wrong in my project. When I try t...
- Upsert with setting permissions
Hi there, I am using self-hosted appwrite v1.7.4 and trying to use the bulk update stuff that was released with 1.7.x. Unfortunally I found that there is an ser...