CORS blocking between dockers, please help

Hello,

I have been trying for the past few days to link up a foundry VTT docker with my jitsi docker and I can't seem to get it working. I am getting the CORS blocked error everytime. (See below)

I added the headers in jitsi, but I am very much a novice at this and perhaps they are not correct.

I am really struggling with this now at this point, as getting everything up and running was a massive learning curve and very enjoyable, but with both servers up and just not being able to get them to talk at the last step I would really appreciate some help.

The error I am getting is

And my Jitsi docker-compose is:

version: '3'

services:
    # Frontend
    web:
        image: jitsi/web
        volumes:
            - ${CONFIG}/web:/config
            - ${CONFIG}/web/letsencrypt:/etc/letsencrypt
            - ${CONFIG}/transcripts:/usr/share/jitsi-meet/transcripts
        environment:
            - ENABLE_AUTH
            - ENABLE_GUESTS
            - ENABLE_LETSENCRYPT
            - ENABLE_HTTP_REDIRECT
            - ENABLE_TRANSCRIPTIONS
            - DISABLE_HTTPS
            - JICOFO_AUTH_USER
            - LETSENCRYPT_DOMAIN
            - LETSENCRYPT_EMAIL
            - PUBLIC_URL
            - XMPP_DOMAIN
            - XMPP_AUTH_DOMAIN
            - XMPP_BOSH_URL_BASE
            - XMPP_GUEST_DOMAIN
            - XMPP_MUC_DOMAIN
            - XMPP_RECORDER_DOMAIN
            - ETHERPAD_URL_BASE
            - ETHERPAD_PUBLIC_URL
            - TZ
            - JIBRI_BREWERY_MUC
            - JIBRI_PENDING_TIMEOUT
            - JIBRI_

XMPP_USER
            - JIBRI_XMP

P_PASSWORD
            - JIBRI_RECORDER_USER
            - JIBRI_RECORDER_PASSWORD
            - ENABLE_RECORDING
        networks:
            # traefik: change the following line to your external docker network 
            web:
            meet.jitsi:
                aliases:
                    - ${XMPP_DOMAIN}
        labels:
            traefik.enable: true
            traefik.http.routers.app-http.entrypoints: web
            traefik.http.routers.app-http.rule: 'Host(`meet.mydomain.com`)'
            traefik.http.services.app.loadbalancer.server.port: 80
            traefik.http.middlewares.routers.headers.accesscontrolallowmethods: GET,HEAD,OPTIONS,POST,PUT
            #traefik.http.middlewares.routers.headers.accesscontrolmaxage: 100
            #traefik.http.middlewares.routers.headers.addvaryheader: true
            traefik.http.middlewares.routers.headers.accessControlAllowCredentials: true
            traefik.http.middlewares.routers.headers.accessControlAllowHeaders: Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers
            traefik.http.middlewares.routers.headers.accesscontrolalloworigin: '*' 

    # XMPP server
    prosody:
        image: jitsi/prosody
        expose:
            - '5222'
            - '5347'
            - '5280'
        volumes:
            - ${CONFIG}/prosody:/config
        environment:
            - AUTH_TYPE
            - ENABLE_AUTH
            - ENABLE_GUESTS
            - GLOBAL_MODULES
            - GLOBAL_CONFIG
            - LDAP_URL
            - LDAP_BASE
            - LDAP_BINDDN
            - LDAP_BINDPW
            - LDAP_FILTER
            - LDAP_AUTH_METHOD
            - LDAP_VERSION
            - LDAP_USE_TLS
            - LDAP_TLS_CIPHERS
            - LDAP_TLS_CHECK_PEER
            - LDAP_TLS_CACERT_FILE
            - LDAP_TLS_CACERT_DIR
            - LDAP_START_TLS
            - XMPP_DOMAIN
            - XMPP_AUTH_DOMAIN
            - XMPP_GUEST_DOMAIN
            - XMPP_MUC_DOMAIN
            - XMPP_INTERNAL_MUC_DOMAIN
            - XMPP_MODULES
            - XMPP_MUC_MODULES
            - XMPP_INTERNAL_MUC_MODULES
            - XMPP_RECORDER_DOMAIN
            - JICOFO_COMPONENT_SECRET
            - JICOFO_AUTH_USER
            - JICOFO_AUTH_PASSWORD
            - JVB_AUTH_USER
            - JVB_AUTH_PASSWORD
            - JIGASI_XMPP_USER
            - JIGASI_XMPP_PASSWORD
            - JIBRI_XMPP_USER
            - JIBRI_XMPP_PASSWORD
            - JIBRI_RECORDER_USER
            - JIBRI_RECORDER_PASSWORD
            - JWT_APP_ID
            - JWT_APP_SECRET
            - JWT_ACCEPTED_ISSUERS
            - JWT_ACCEPTED_AUDIENCES
            - JWT_ASAP_KEYSERVER
            - JWT_ALLOW_EMPTY
            - JWT_AUTH_TYPE
            - JWT_TOKEN_AUTH_MODULE
            - LOG_LEVEL
            - TZ
        networks:
            meet.jitsi:
                aliases:
                    - ${XMPP_SERVER}
        labels:
            traefik.enable: true
           # traefik.http.routers.app-http.entrypoints: web
           # traefik.http.routers.app-http.rule: 'Host(`meet.mydomain.com`)'
            #traefik.http.services.app.loadbalancer.server.port: 80
            #traefik.http.middlewares.routers.headers.accesscontrolallowmethods: GET,HEAD,OPTIONS,POST,PUT
            #traefik.http.middlewares.routers.headers.accesscontrolmaxage: 100
            #traefik.http.middlewares.routers.headers.addvaryheader: true
            traefik.http.middlewares.routers.headers.accesscontrolallowmethods: GET,HEAD,OPTIONS,POST,PUT
            #traefik.http.middlewares.routers.headers.accesscontrolmaxage: 100
            #traefik.http.middlewares.routers.headers.addvaryheader: true
            traefik.http.middlewares.routers.headers.accessControlAllowCredentials: true
            traefik.http.middlewares.routers.headers.accessControlAllowHeaders: Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers
            traefik.http.middlewares.routers.headers.accesscontrolalloworigin: '*' 


    # Focus component
    jicofo:
        image: jitsi/jicofo
        volumes:
            - ${CONFIG}/jicofo:/config
        environment:
            - ENABLE_AUTH
            - XMPP_DOMAIN
            - XMPP_AUTH_DOMAIN
            - XMPP_INTERNAL_MUC_DOMAIN
            - XMPP_SERVER
            - JICOFO_COMPONENT_SECRET
            - JICOFO_AUTH_USER
            - JICOFO_AUTH_PASSWORD
            - JICOFO_RESERVATION_REST_BASE_URL
            - JVB_BREWERY_MUC
            - JIGASI_BREWERY_MUC
            - JIBRI_BREWERY_MUC
            - JIBRI_PENDING_TIMEOUT
            - TZ
        depends_on:
            - prosody
        networks:
            meet.jitsi:

    # Video bridge
    jvb:
        image: jitsi/jvb
        ports:
            - '${JVB_PORT}:${JVB_PORT}/udp'
            - '${JVB_TCP_MAPPED_PORT}:${JVB_TCP_PORT}'
        volumes:
            - ${CONFIG}/jvb:/config
        environment:
            - DOCKER_HOST_ADDRESS
            - XMPP_AUTH_DOMAIN
            - XMPP_INTERNAL_MUC_DOMAIN
            - XMPP_SERVER
            - JVB_AUTH_USER
            - JVB_AUTH_PASSWORD
            - JVB_BREWERY_MUC
            - JVB_PORT
            - JVB_TCP_HARVESTER_DISABLED
            - JVB_TCP_PORT
            - JVB_STUN_SERVERS
            - JVB_ENABLE_APIS
            - TZ
        depends_on:
            - prosody
        networks:
            meet.jitsi:
        labels:
            traefik.udp.routers.jvb.entrypoints: video
            traefik.udp.routers.jvb.service: jvb
            traefik.udp.services.jvb.loadbalancer.server.port: 10000

# Custom network so all services can communicate using a FQDN
networks:
    meet.jitsi:
    # traefik: change the following line to your external docker network 
    web:
        external: true

Hi @CrispyNacho

You have defined the middlewares but they are not attached to a router.

You need a line like:
traefik.http.routers.app-http.middlewares: routers

Personally I'd name the middlewares something else, but personal choice.

You also redefine the middleware in the next service prosody(I'd remove the labels). I'm not sure what the outcome would be. If I have a middleware that I am using on multiple services I define it in the Traefik container.