Repetive
appwrite-traefik | 2023/03/13 18:15:01 traefik.go:80: command traefik error: error while building entryPoint appwrite_web: error preparing http server: parsing CIDR trusted IPs <nil>: invalid CIDR address: <IP of NPM container>```
don't include the actual <>
sorry, didn't get you
like:
--entrypoints.appwrite_websecure.forwardedHeaders.trustedIPs=172.22.0.2
ohh my!
ok, now Appwrite accessible directly by port but not by domain name api.my-domain.name
as configured in NPM
What's the output of docker inspect npm_gateway
now?
{
"Name": "npm_gateway",
"Id": "d372f2981bc8fce7b400512795375c21b28f0fe855ce14ca414ef6dd679e2f01",
"Created": "2023-03-13T20:49:05.03979175+03:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.22.0.0/16",
"Gateway": "172.22.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"11fd0a365247e33088dd90ae9d5c785f78be2c3e5ef30577327474106bad5dc6": {
"Name": "appwrite-traefik",
"EndpointID": "c28f3c50156d192881c5d69390bc4f2675795fc13f2c74e6e444122bcf9adfe8",
"MacAddress": "02:42:ac:16:00:03",
"IPv4Address": "172.22.0.3/16",
"IPv6Address": ""
},
"1d04dfa09df240f7f79caf3f2114b46650249f5f2176795b58533c4253cdf851": {
"Name": "npm-app-1",
"EndpointID": "5c93c995cb8b5789f174785fddc347c893835c35607de63b5c4c44663e339329",
"MacAddress": "02:42:ac:16:00:02",
"IPv4Address": "172.22.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "gateway",
"com.docker.compose.project": "npm",
"com.docker.compose.version": "2.16.0"
}
}
]```
good. appwrite is in the NPM network. what did you do in NPM for the vhost?
Did you mean Proxy host settings?
If so this is my settings and SSL cert created as well
the port should be 443
So the logic is: NPM listen connection to domain name
on Forward Port, user opens domain name
then NPM redirects him to the https-protocol, to appwrite-traefik container (since it in the same network), correct?
Yep!
So, Appwrite finally alive and running fine. Now I can't run FE using another httpd-server
container. Trying to do it in the same way as Traefik I can access it directly by IP:PORT but no via domain name, got 502 error. And my domain name is my-domain.name
similar to Appwrite's api.my-domain.name
. Inspecting NPM network I realized that my front-end app not in the NPM network. Assume that I have to do some config in my frontend-app container?
yes you need to make sure your front end app is in the network just like how you did with appwrite's traefik container
So my new docker-compose is:
version: '3.9'
services:
apache:
image: httpd:latest
container_name: fe-app
ports:
- '3300:80'
volumes:
- ./www:/usr/local/apache2/htdocs
networks:
gateway:
name: npm_gateway
external: true
again, you need to make sure your app is in the network. declaring a network at the bottom doesn't put it in the network
Well, front-end app is in the NPM network now:
"11fd0a365247e33088dd90ae9d5c785f78be2c3e5ef30577327474106bad5dc6": {
"Name": "appwrite-traefik",
"EndpointID": "4544b3d4e7f7a69ae29e89ddb19a0352cca5320e39d90322c5d9a53d36dc4f6a",
"MacAddress": "02:42:ac:16:00:02",
"IPv4Address": "172.22.0.2/16",
"IPv6Address": ""
},
"1d04dfa09df240f7f79caf3f2114b46650249f5f2176795b58533c4253cdf851": {
"Name": "npm-app-1",
"EndpointID": "6226a0f36d7030649a0e801f7cd6e626ec3667fd5ec8ab9f49287e9e4621154f",
"MacAddress": "02:42:ac:16:00:03",
"IPv4Address": "172.22.0.3/16",
"IPv6Address": ""
},
"cca43df53d10aeff8893d163be674f8a5fed77f30cc84451246778b9c5bb735f": {
"Name": "fe-app",
"EndpointID": "b3fd4cb0d3c30daf2e69272848621f55de39d68e3292e45bad100cc1031596e4",
"MacAddress": "02:42:ac:16:00:04",
"IPv4Address": "172.22.0.4/16",
"IPv6Address": ""
}
},
But I can't access my FE app via domain name
why are you doing all this fuss ? you just neded to forward it to a port or container name in nginx proxy manager?
when installing appwrite just chose different port than 80, and that's that, no ?
i got a setup just like that at my home lab, running on 88 with np.
what error are you getting? and what did you do for your vhost?
It was 502 error, but after some updates in the vhost it works fine now. Thank you very much!
[SOLVED] NGINX before Appwrite and frontend app
Recommended threads
- Having issues with login via CLI
``` ~/appwrite ξ° appwrite login --endpoint https://localhost/v1 --verbose ? Enter your email myvalidemai...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...