"redirect uri mismatch" Google Auth self hosted not using https as redirect uri
- 1
- Self Hosted
- Auth
- Web
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
I am using self-hosted appwrite, running on http on a custom port (8000). Then, I am using Caddy as reverse proxy to map my subdomain appwrite.domain.com to port 8000 and Caddy manages the TLS certificates. HTTPS works correctly on the admin panel. As you can see in screenshot 1, admin panel tells me to use https for my redirect uri. However, when I try to create an oauth session, I get the error redirect_uri_mismatch (Screenshot 2) As you can see in Screenshot 3, it tries using the URI with http instead of https.
How can I fix this?
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
When I set tls_insecure_skip_verify, I get "404 page not found" again.
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
But why would I set tls_insecure_skip_verify? After settings my app domain to localhost, I was actually relying on caddy for https on domain level, am I wrong?
![](https://cdn.discordapp.com/avatars/850167131600846898/7abfcf2df0ae47d2085eb4296d2f9a59.webp)
I am not a Caddy user but my understanding is that it stops Caddy from requiring a valid certificate on your upstream server (appwrite).
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
Yes but I have my domain "appwrite.abc.com" and I have appwrite configured with APP_DOMAIN=localhost, so some service has to generate the TLS certificate for "appwrite.abc.com", that's Caddy in my case that's why I don't think setting tls_insecure_skip_verify would do any good
![](https://cdn.discordapp.com/avatars/675081362583060492/5ddf59314425afc5058a43519861f723.webp)
Have you checked if in the env., the parameter _APP_OPTIONS_FORCE_HTTPS is enabled ?
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
no it was disabled, but now I get ERR_TOO_MANY_REDIRECTS
![](https://cdn.discordapp.com/avatars/675081362583060492/5ddf59314425afc5058a43519861f723.webp)
I'm facing the same issue, trying to investigate how to solve it on my side too. Only difference : I'm using Cloudflare
![](https://cdn.discordapp.com/avatars/675081362583060492/5ddf59314425afc5058a43519861f723.webp)
Maybe this https://discord.com/channels/564160730845151244/1100400815065272320 can help you
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
I also opened this https://github.com/appwrite/appwrite/issues/8421
![](https://cdn.discordapp.com/avatars/675081362583060492/5ddf59314425afc5058a43519861f723.webp)
Now I have Error 412: project_provider_disabled, even if the provider (Google) is enable in the console. Feel I'm going backward 😂 Good luck!
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
But you're running appwrite on ports 80 and 443, aren't you?
![](https://cdn.discordapp.com/avatars/675081362583060492/5ddf59314425afc5058a43519861f723.webp)
Yes
![](https://cdn.discordapp.com/avatars/675081362583060492/5ddf59314425afc5058a43519861f723.webp)
I check documentation, _APP_OPTIONS_FORCE_HTTPS is used only for 80 & 443 default port. So probably not solving your problem
![](https://cdn.discordapp.com/avatars/850167131600846898/7abfcf2df0ae47d2085eb4296d2f9a59.webp)
@Jamy I had the provider disabled error in appwrite after testing out the changing port in my reverse proxy to 80 and then back to 443. I did this to verify that appwrite's redirect URL was being generated according to which port it was being accessed by from the original issue in this thread. I believe I had to docker compose down
and then docker compose up -d --remove-orphans
Not sure if the removing orphans helped but that ended up resolving my issue. I am also using Cloudflare as well.
![](https://cdn.discordapp.com/avatars/850167131600846898/7abfcf2df0ae47d2085eb4296d2f9a59.webp)
@Tobi696 regardless of whether you use 80 & 443, 8000 & 8443, etc. My tests show that the redirect URI is generated based on whether it was initiated on appwrite's HTTP port or HTTPS port. When you have your proxy pointing at the HTTP port it is going to generate an HTTP redirect according to my testing.
Back to the Caddy TLS insecure - Caddy still terminates the SSL for anything that is being proxied through Caddy so communication between client and caddy is encrypted. My understanding is that tls_insecure_skip_verify allows Caddy to proxy to an "insecure"/"invalid"/"self-signed" etc certificate. The data is still encrypted between Caddy and Appwrite, it just isn't with a publicly trusted certificate.
![](https://cdn.discordapp.com/avatars/675081362583060492/5ddf59314425afc5058a43519861f723.webp)
Thanks for your reply, don't want to spam here about my problem, sorry. I did what you suggested, but still the same issue :/ Tried also to disable/enable, and disable -> restart docker -> enable..
![](https://cdn.discordapp.com/avatars/850167131600846898/7abfcf2df0ae47d2085eb4296d2f9a59.webp)
What client are you using to test with?
![](https://cdn.discordapp.com/avatars/675081362583060492/5ddf59314425afc5058a43519861f723.webp)
Not sure to understand. I'm using Flutter, on Android emulator. I will open a new thread, and let focus here about @Tobi696 issue
![](https://cdn.discordapp.com/avatars/850167131600846898/7abfcf2df0ae47d2085eb4296d2f9a59.webp)
I ask because I think I had to clear app storage in Dev tools I think it was for flutter web or close all the way out and rebuild the app
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
Yeah if only I got it to work using the https port 🙈
![](https://cdn.discordapp.com/avatars/850167131600846898/7abfcf2df0ae47d2085eb4296d2f9a59.webp)
How about trying to disable the port 80 forward on your firewall to force cloudflare to use 443?
![](https://cdn.discordapp.com/avatars/475538395800666112/52f8e1ac9916891976220624081d6261.webp)
I'm not using cloudflare
![](https://cdn.discordapp.com/avatars/1087889306208718959/b697c2b399c82d084236adc588bb6375.webp)
Do you can DM me the redirect URL?
![](https://cdn.discordapp.com/avatars/1087889306208718959/b697c2b399c82d084236adc588bb6375.webp)
What's the appwrite version you're using?
Recommended threads
- login appwrite cli
hi, I'm trying to use appwrite cli in my terminal but since I login using my github account in the console, i dont have a password for the account, any idea of ...
- Clicksend
Hi all, Is there a way to connect Clicksend as a provider
- /v1/account/verification - 503 Service U...
Unable to send email verification, errror - SMTP disabled
![](/images/bgs/pre-footer.png)