因此,我正在使用traefik作为代理来构建解析服务器。
当我尝试运行查询时,我得到
curl: (7) Failed to connect to dev.vetpresso.io port 443: Operation timed out
如果将URL更改为dev.vetpresso.io:1337(服务器正在运行的端口),则可以毫无疑问地获得查询。所以我的IP指向正确的服务器。
这是我的docker文件
version: '3.3'
services:
trafik:
image: traefik:v2.0
ports:
- 80:80
- 443:443
networks:
- web
volumes:
- /etc/localtime:/etc/localtime
- /var/run/docker.sock:/var/run/docker.sock
- /opt/containers/traefik/data/traefik.yml:/traefik.yml
- /opt/containers/traefik/data/acme.json:/acme.json
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`dev-traefik.vetpresso.io`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=user:pass"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`dev-traefik.vetpresso.io`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=http"
- "traefik.http.routers.traefik-secure.service=api@internal"
mongo:
image: mongo
ports:
- 27017:27017
networks:
- mongo
volumes:
- ./data-db:/data/db
parse:
image: parseplatform/parse-server
container_name: parse
ports:
- 1337:1337
networks:
- web
- mongo
links:
- mongo
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- PARSE_SERVER_APPLICATION_ID=appid
- PARSE_SERVER_MASTER_KEY=masterkey
- PARSE_SERVER_DATABASE_URI=mongodb://mongo:27017
- PARSE_SERVER_START_LIVE_QUERY_SERVER=1
- PARSE_SERVER_LIVE_QUERY={"classNames":["people","monitor"]}
labels:
- traefik.enable=true
- traefik.http.routers.parse.entrypoints=http
- traefik.http.routers.parese.rule=Host(`dev.vetpresso.io`)
- traefik.http.middlewares.parse-https-redirect.redirectscheme.scheme=https
- traefik.http.routers.parse.middlewares=portainer-https-redirect
- traefik.http.routers.parse-secure.entrypoints=https
- traefik.http.routers.parse-secure.rule=Host(`dev.vetpresso.io`)
- traefik.http.routers.parse-secure.tls=true
- traefik.http.routers.parse-secure.tls.certresolver=http
- traefik.http.routers.parse-secure.service=parse
- traefik.http.services.parse.loadbalancer.server.port=1337
- traefik.docker.network=web
dashboard:
image: parseplatform/parse-dashboard
ports:
- 4040:4040
environment:
- PARSE_DASHBOARD_SERVER_URL=http://99.79.78.141:1337/parse
- PARSE_DASHBOARD_APP_ID=APPID
- PARSE_DASHBOARD_MASTER_KEY=MASTERKEY
- PARSE_DASHBOARD_APP_NAME=Vetpresso
- PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1
- PARSE_DASHBOARD_USER_ID=user
- PARSE_DASHBOARD_USER_PASSWORD=pass
networks:
mongo:
web:
external: true
我的配置文件从字面上是https://medium.com/@containeroo/traefik-2-0-docker-a-simple-step-by-step-guide-e0be0c17cfa5的复制粘贴
我不确定为什么它无法连接。