I've just noticed that when I use my IP address with the port where Appwrite is installed on my server, they all work very well. But when I use the reverse proxy domain name linked to the ip address mentioned above, the problem starts all over again.
This locale problem is different. Let's keep that conversation on that other thread
You need something like this if you use apache:
RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:8000/$1 [P,L]
change the IP and Port based on what you have
okay
Let me try
I have same error 😅
- What did you add exactly?
- What ports are being used by your appwrite instance?
- Perhaps you also need
RewriteCond %{HTTP:Connection} upgrade [NC]
1 .... `<VirtualHost *:80> ServerName mboasms.cm ServerAlias www.mboasms.cm
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://localhost:89/
ProxyPassReverse / http://localhost:89/
RewriteEngine on
RewriteCond %{SERVER_NAME} =mboasms.cm [OR]
RewriteCond %{SERVER_NAME} =www.mboasms.cm
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://78.46.11.35:89/$1 [P,L]
</VirtualHost>`
- port 89 for http and 90 for https
Are you sure alias is correct? Also did you have tried instead of localhost, setting the server IP?
When a i use Ip i have error.
`<VirtualHost *:80> ServerName mboasms.cm ServerAlias www.mboasms.cm
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://78.46.11.35:89/
ProxyPassReverse / http://78.46.11.35:89/
RewriteEngine on
RewriteCond %{SERVER_NAME} =mboasms.cm [OR]
RewriteCond %{SERVER_NAME} =www.mboasms.cm
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule /(.*) ws://78.46.11.35:89/$1 [P,L]
</VirtualHost>`
make sure you use 3 backticks for multi line code
is apache on the same server as Appwrite?
Yes
I would suggest proxying to HTTPS and localhost and also enabling firewall to block port 89 and 90
so maybe something like:
<VirtualHost *:80>
ServerName mboasms.cm
ServerAlias www.mboasms.cm
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://locaol:89/
ProxyPassReverse / http://localhost:89/
RewriteEngine on
RewriteCond %{SERVER_NAME} =mboasms.cm [OR]
RewriteCond %{SERVER_NAME} =www.mboasms.cm
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule /(.*) ws://localhost:89/$1 [P,L]
</VirtualHost>
but also this is only the port 80 apache config. you need the port 443 one too
I have applied your suggestions but the problem persists. 😅 😭
What's your 443 apache config?
`<VirtualHost *:443> ServerName mboasms.cm ServerAlias www.mboasms.cm
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
<Proxy *>
Require all granted
</Proxy>
ProxyPass / https://localhost:90/
ProxyPassReverse / https://localhost:90/
RewriteEngine on
RewriteCond %{SERVER_NAME} =mboasms.cm [OR]
RewriteCond %{SERVER_NAME} =www.mboasms.cm
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule /(.*) wss://localhost:90/$1 [P,L]
</VirtualHost>`
Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
So what's the error now?
The same error when i remove client.setSelfSigned()
Recommended threads
- SSR share session to client using custom...
Hi, so I was trying to get a hang of using SSR and using realtime updates in the same time which is done easiest if you have a custom domain in Appwrite and as ...
- Getting error when trying to add domain ...
we use self hosted appwrite on my company and every single time ever I tried to add a domain it shows this error on the top rigth: "Cannot read properties of un...
- Using OTP Email to verify user for passw...
Has anyone ever implemented this? If you did what was your aproach? Did you write an appwrite function?