bunkerity / bunkerweb

🛡️ Open-source and next-generation Web Application Firewall (WAF)
https://www.bunkerweb.io
GNU Affero General Public License v3.0
6.2k stars 343 forks source link

[BUG] CORS Error #283

Closed amrap030 closed 2 years ago

amrap030 commented 2 years ago

Hello,

I am trying to use Bunkerweb as a reverse proxy to route traffic from a subdomain to the corresponding application. This is my docker-compose.yml file, which I created with the help of the configurator:

version: "3"
services:
  mybunker:
    image: bunkerity/bunkerweb:1.4.2
    ports:
      - 80:8080
      - 443:8443
    environment:
      - MULTISITE=yes
      - SERVER_NAME=
      - API_WHITELIST_IP=127.0.0.0/8 10.20.30.0/24
      - HTTP_PORT=8080
      - HTTPS_PORT=8443
      - AUTOCONF_MODE=yes
      - DISABLE_DEFAULT_SERVER=yes
      - LOG_LEVEL=debug
    labels:
      - "bunkerweb.AUTOCONF"
    networks:
      - bw-autoconf
      - bw-services

  myautoconf:
    image: bunkerity/bunkerweb-autoconf:1.4.2
    volumes:
      - ./bw-data:/data
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - bw-autoconf

  api_magic-mondrian_art:
    image: amrap030/whitelabel-backend
    ports:
      - 8081
    depends_on:
      - redis
    restart: unless-stopped
    volumes:
      - /opt/mondrians/config.js:/usr/src/config.js
    networks:
      bw-services:
        aliases:
          - api_magic-mondrian_art
    labels:
      - "bunkerweb.SERVER_NAME=api.magic-mondrian.art"
      - "bunkerweb.USE_CLIENT_CACHE=yes"
      - "bunkerweb.USE_GZIP=yes"
      - "bunkerweb.AUTO_LETS_ENCRYPT=yes"
      - "bunkerweb.EMAIL_LETS_ENCRYPT=***@t-online.de"
      - "bunkerweb.REDIRECT_HTTP_TO_HTTPS=yes"
      - "bunkerweb.USE_REVERSE_PROXY=yes"
      - "bunkerweb.USE_PROXY_CACHE=yes"
      - "bunkerweb.REVERSE_PROXY_URL=/"
      - "bunkerweb.REVERSE_PROXY_HOST=http://api_magic-mondrian_art:8081"
      - "bunkerweb.USE_MODSECURITY=no"
      - "bunkerweb.COOKIE_FLAGS=* SameSite=Lax"
      - "bunkerweb.USE_LETS_ENCRYPT_STAGING=yes"

  redis:
    image: "redis:alpine"
    command: redis-server
    ports:
      - 6379
    restart: unless-stopped
    networks:
      bw-services:
        aliases:
          - redis_magic-mondrian_art

volumes:
  bw-confs:

networks:
  bw-autoconf:
    ipam:
      driver: default
      config:
        - subnet: 10.20.30.0/24
  bw-services:

The certificate creation is working. When I make a request to the url, it first makes an OPTIONS request which succeeds, but it doesn't return the corresponding Headers, which results into a CORS Error. My application has setup CORS correct, so nginx or bunkerweb seems to be the bottleneck here. I am not even receiving the request in my application because of the CORS error.

I already tried this https://github.com/bunkerity/bunkerweb/issues/24 with no luck.

So what am I doing wrong?

amrap030 commented 2 years ago

This is the response header from the OPTIONS request:

Bildschirmfoto 2022-08-04 um 02 01 04

There are no CORS headers attached such as access-control-allow-origin: https://www.magic-mondrian.art and access-control-allow-methods: POST, so that is why I get CORS errors I guess.

amrap030 commented 2 years ago

I also have some logs here:

myautoconf_1              | [2022-08-04 00:41:41] DOCKER-CONTROLLER - ℹ️ - Catched docker event, deploying new configuration ...
myautoconf_1              | [2022-08-04 00:41:42] SCHEDULER - ℹ️ - Executing job bunkernet-register from plugin bunkernet ...
myautoconf_1              | [2022-08-04 00:41:43] BUNKERNET - ℹ️ - Already registered on BunkerNet API with instance id e52183c4-c766-4962-a34d-3e37ea6a3e96
myautoconf_1              | [2022-08-04 00:41:43] BUNKERNET - ℹ️ - Checking connectivity with BunkerNet API ...
myautoconf_1              | [2022-08-04 00:41:43] BUNKERNET - ⚠️ - BunkerNet API is rate limiting us, trying again later...
myautoconf_1              | [2022-08-04 00:41:43] SCHEDULER - ℹ️ - Successfuly executed job bunkernet-register from plugin bunkernet
myautoconf_1              | [2022-08-04 00:41:43] SCHEDULER - ℹ️ - Executing job bunkernet-data from plugin bunkernet ...
myautoconf_1              | [2022-08-04 00:41:43] BUNKERNET - ℹ️ - BunkerNet list is already in cache, skipping download...
myautoconf_1              | [2022-08-04 00:41:43] SCHEDULER - ℹ️ - Successfuly executed job bunkernet-data from plugin bunkernet
myautoconf_1              | [2022-08-04 00:41:43] SCHEDULER - ℹ️ - Executing job custom-cert from plugin customcert ...
myautoconf_1              | [2022-08-04 00:41:43] SCHEDULER - ℹ️ - Successfuly executed job custom-cert from plugin customcert
myautoconf_1              | [2022-08-04 00:41:43] SCHEDULER - ℹ️ - Executing job certbot-new from plugin letsencrypt ...
myautoconf_1              | [2022-08-04 00:41:43] LETS-ENCRYPT - ℹ️ - Certificates already exists for domain(s) api2.magic-mondrian.art
myautoconf_1              | [2022-08-04 00:41:43] SCHEDULER - ℹ️ - Successfuly executed job certbot-new from plugin letsencrypt
myautoconf_1              | [2022-08-04 00:41:43] SCHEDULER - ℹ️ - Executing job certbot-renew from plugin letsencrypt ...
myautoconf_1              | Saving debug log to /var/log/letsencrypt/letsencrypt.log
myautoconf_1              | 
myautoconf_1              | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
myautoconf_1              | Processing /etc/letsencrypt/renewal/api2.magic-mondrian.art.conf
myautoconf_1              | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
myautoconf_1              | Certificate not yet due for renewal
myautoconf_1              | 
myautoconf_1              | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
myautoconf_1              | The following certificates are not due for renewal yet:
myautoconf_1              |   /etc/letsencrypt/live/api2.magic-mondrian.art/fullchain.pem expires on 2022-11-01 (skipped)
myautoconf_1              | No renewals were attempted.
myautoconf_1              | No hooks were run.
myautoconf_1              | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
myautoconf_1              | [2022-08-04 00:41:45] LETS-ENCRYPT - ℹ️ - Certificates renewal for api2.magic-mondrian.art successful
myautoconf_1              | [2022-08-04 00:41:45] SCHEDULER - ℹ️ - Successfuly executed job certbot-renew from plugin letsencrypt
myautoconf_1              | [2022-08-04 00:41:45] SCHEDULER - ℹ️ - Executing job blacklist-download from plugin blacklist ...
myautoconf_1              | [2022-08-04 00:41:46] BLACKLIST - ℹ️ - Blacklist for IP is already in cache, skipping downloads...
myautoconf_1              | [2022-08-04 00:41:46] BLACKLIST - ℹ️ - Blacklist for RDNS is not cached, processing downloads..
myautoconf_1              | [2022-08-04 00:41:46] BLACKLIST - ℹ️ - Blacklist for ASN is not cached, processing downloads..
myautoconf_1              | [2022-08-04 00:41:46] BLACKLIST - ℹ️ - Blacklist for USER_AGENT is already in cache, skipping downloads...
myautoconf_1              | [2022-08-04 00:41:46] BLACKLIST - ℹ️ - Blacklist for URI is not cached, processing downloads..
myautoconf_1              | [2022-08-04 00:41:46] SCHEDULER - ℹ️ - Successfuly executed job blacklist-download from plugin blacklist
myautoconf_1              | [2022-08-04 00:41:46] SCHEDULER - ℹ️ - Executing job mmdb-country from plugin jobs ...
myautoconf_1              | [2022-08-04 00:41:46] JOBS - ℹ️ - country.mmdb is already in cache, skipping download...
myautoconf_1              | [2022-08-04 00:41:46] SCHEDULER - ℹ️ - Successfuly executed job mmdb-country from plugin jobs
myautoconf_1              | [2022-08-04 00:41:46] SCHEDULER - ℹ️ - Executing job mmdb-asn from plugin jobs ...
myautoconf_1              | [2022-08-04 00:41:46] JOBS - ℹ️ - asn.mmdb is already in cache, skipping download...
myautoconf_1              | [2022-08-04 00:41:46] SCHEDULER - ℹ️ - Successfuly executed job mmdb-asn from plugin jobs
myautoconf_1              | [2022-08-04 00:41:46] SCHEDULER - ℹ️ - Executing job download-plugins from plugin jobs ...
myautoconf_1              | [2022-08-04 00:41:46] JOBS - ℹ️ - No external plugins to download
myautoconf_1              | [2022-08-04 00:41:46] SCHEDULER - ℹ️ - Successfuly executed job download-plugins from plugin jobs
myautoconf_1              | [2022-08-04 00:41:46] SCHEDULER - ℹ️ - Executing job realip-download from plugin realip ...
myautoconf_1              | [2022-08-04 00:41:47] REALIP - ℹ️ - RealIP is not activated, skipping download...
myautoconf_1              | [2022-08-04 00:41:47] SCHEDULER - ℹ️ - Successfuly executed job realip-download from plugin realip
myautoconf_1              | [2022-08-04 00:41:47] SCHEDULER - ℹ️ - Executing job whitelist-download from plugin whitelist ...
myautoconf_1              | [2022-08-04 00:41:47] WHITELIST - ℹ️ - Whitelist for IP is not cached, processing downloads...
myautoconf_1              | [2022-08-04 00:41:47] WHITELIST - ℹ️ - Whitelist for RDNS is not cached, processing downloads...
myautoconf_1              | [2022-08-04 00:41:47] WHITELIST - ℹ️ - Whitelist for ASN is not cached, processing downloads...
myautoconf_1              | [2022-08-04 00:41:47] WHITELIST - ℹ️ - Whitelist for USER_AGENT is not cached, processing downloads...
myautoconf_1              | [2022-08-04 00:41:47] WHITELIST - ℹ️ - Whitelist for URI is not cached, processing downloads...
myautoconf_1              | [2022-08-04 00:41:47] SCHEDULER - ℹ️ - Successfuly executed job whitelist-download from plugin whitelist
myautoconf_1              | [2022-08-04 00:41:47] SCHEDULER - ℹ️ - Executing job self-signed from plugin selfsigned ...
myautoconf_1              | [2022-08-04 00:41:47] SCHEDULER - ℹ️ - Successfuly executed job self-signed from plugin selfsigned
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Generator started ...
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Settings : /opt/bunkerweb/settings.json
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Templates : /opt/bunkerweb/confs
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Core : /opt/bunkerweb/core
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Plugins : /opt/bunkerweb/plugins
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Output : /etc/nginx
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Target : /etc/nginx
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Variables : /tmp/variables.env
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Checking arguments ...
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Computing config ...
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Removing old files ...
myautoconf_1              | [2022-08-04 00:41:47] GENERATOR - ℹ️ - Rendering templates ...
myautoconf_1              | [2022-08-04 00:41:48] GENERATOR - ℹ️ - Generator successfully executed !
mybunker_1                | 2022/08/04 00:41:48 [debug] 56#56: *8 [lua] ipmatcher.lua:223: new(): ipv4 mask: 8 valid inet: 127
mybunker_1                | 2022/08/04 00:41:48 [debug] 56#56: *8 [lua] ipmatcher.lua:223: new(): ipv4 mask: 24 valid inet: 660510
mybunker_1                | 2022/08/04 00:41:48 [debug] 56#56: *8 [lua] ipmatcher.lua:327: match(): ipv4 mask: 24 valid inet: 660510
mybunker_1                | 2022/08/04 00:41:48 [notice] 56#56: *8 [API] Validated access from IP 10.20.30.2, client: 10.20.30.2, server: bwapi, request: "POST /confs HTTP/1.1", host: "bwapi"
mybunker_1                | 2022/08/04 00:41:48 [notice] 56#56: signal 17 (SIGCHLD) received from 65
mybunker_1                | 2022/08/04 00:41:48 [info] 56#56: waitpid() failed (10: No child process)
mybunker_1                | 2022/08/04 00:41:48 [notice] 56#56: signal 17 (SIGCHLD) received from 66
mybunker_1                | 2022/08/04 00:41:48 [info] 56#56: waitpid() failed (10: No child process)
mybunker_1                | 2022/08/04 00:41:48 [notice] 56#56: *8 [API] Successful call from 10.20.30.2 on /confs : saved data at /etc/nginx, client: 10.20.30.2, server: bwapi, request: "POST /confs HTTP/1.1", host: "bwapi"
myautoconf_1              | [2022-08-04 00:41:48] API - ℹ️ - Successfully sent API request to http://mondrians_mybunker_1:5000/confs
mybunker_1                | bwapi 10.20.30.2 - - [04/Aug/2022:00:41:48 +0000] "POST /confs HTTP/1.1" 200 67 "-" "bwapi"
mybunker_1                | 2022/08/04 00:41:48 [info] 56#56: *8 client 10.20.30.2 closed keepalive connection
mybunker_1                | 2022/08/04 00:42:00 [debug] 56#56: *10 [lua] ipmatcher.lua:223: new(): ipv4 mask: 8 valid inet: 127
mybunker_1                | 2022/08/04 00:42:00 [debug] 56#56: *10 [lua] ipmatcher.lua:223: new(): ipv4 mask: 24 valid inet: 660510
mybunker_1                | 2022/08/04 00:42:00 [debug] 56#56: *10 [lua] ipmatcher.lua:327: match(): ipv4 mask: 24 valid inet: 660510
mybunker_1                | 2022/08/04 00:42:00 [notice] 56#56: *10 [API] Validated access from IP 10.20.30.2, client: 10.20.30.2, server: bwapi, request: "POST /data HTTP/1.1", host: "bwapi"
mybunker_1                | 2022/08/04 00:42:00 [notice] 56#56: signal 17 (SIGCHLD) received from 75
mybunker_1                | 2022/08/04 00:42:00 [info] 56#56: waitpid() failed (10: No child process)
mybunker_1                | 2022/08/04 00:42:01 [notice] 56#56: signal 17 (SIGCHLD) received from 76
mybunker_1                | 2022/08/04 00:42:01 [info] 56#56: waitpid() failed (10: No child process)
mybunker_1                | 2022/08/04 00:42:01 [notice] 56#56: *10 [API] Successful call from 10.20.30.2 on /data : saved data at /data, client: 10.20.30.2, server: bwapi, request: "POST /data HTTP/1.1", host: "bwapi"
myautoconf_1              | [2022-08-04 00:42:01] API - ℹ️ - Successfully sent API request to http://mondrians_mybunker_1:5000/data
mybunker_1                | bwapi 10.20.30.2 - - [04/Aug/2022:00:42:00 +0000] "POST /data HTTP/1.1" 200 61 "-" "bwapi"
mybunker_1                | 2022/08/04 00:42:01 [info] 56#56: *10 client 10.20.30.2 closed keepalive connection
mybunker_1                | 2022/08/04 00:42:01 [debug] 56#56: *11 [lua] ipmatcher.lua:223: new(): ipv4 mask: 8 valid inet: 127
mybunker_1                | 2022/08/04 00:42:01 [debug] 56#56: *11 [lua] ipmatcher.lua:223: new(): ipv4 mask: 24 valid inet: 660510
mybunker_1                | 2022/08/04 00:42:01 [debug] 56#56: *11 [lua] ipmatcher.lua:327: match(): ipv4 mask: 24 valid inet: 660510
mybunker_1                | 2022/08/04 00:42:01 [notice] 56#56: *11 [API] Validated access from IP 10.20.30.2, client: 10.20.30.2, server: bwapi, request: "POST /reload HTTP/1.1", host: "bwapi"
mybunker_1                | 2022/08/04 00:42:01 [notice] 78#78: ModSecurity-nginx v1.0.2 (rules loaded inline/local/remote: 0/0/0)
mybunker_1                | 2022/08/04 00:42:01 [notice] 78#78: signal process started
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: signal 1 (SIGHUP) received from 78, reconfiguring
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: reconfiguring
mybunker_1                | 2022/08/04 00:42:01 [notice] 56#56: signal 17 (SIGCHLD) received from 78
mybunker_1                | 2022/08/04 00:42:01 [info] 56#56: waitpid() failed (10: No child process)
mybunker_1                | 2022/08/04 00:42:01 [notice] 56#56: *11 [API] Successful call from 10.20.30.2 on /reload : reload successful, client: 10.20.30.2, server: bwapi, request: "POST /reload HTTP/1.1", host: "bwapi"
myautoconf_1              | [2022-08-04 00:42:01] API - ℹ️ - Successfully sent API request to http://mondrians_mybunker_1:5000/reload
myautoconf_1              | [2022-08-04 00:42:01] DOCKER-CONTROLLER - ℹ️ - Successfully deployed new configuration 🚀
mybunker_1                | bwapi 10.20.30.2 - - [04/Aug/2022:00:42:01 +0000] "POST /reload HTTP/1.1" 200 58 "-" "bwapi"
mybunker_1                | 2022/08/04 00:42:01 [info] 56#56: *11 client 10.20.30.2 closed keepalive connection
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: ModSecurity-nginx v1.0.2 (rules loaded inline/local/remote: 0/0/0)
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Init phase started
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Deleted ^plugin_ from datastore
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Deleted ^variable_ from datastore
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Deleted ^plugins$ from datastore
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Deleted ^api_ from datastore
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Deleted ^misc_ from datastore
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin php v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin brotli v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin headers v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin ui v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin reverseproxy v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin bunkernet v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin customcert v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin badbehavior v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin antibot v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin modsecurity v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin gzip v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin authbasic v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin letsencrypt v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin blacklist v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin limit v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin country v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin misc v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin errors v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin jobs v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin realip v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin whitelist v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin dnsbl v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin selfsigned v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin redirect v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin clientcache v0.1
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Loaded plugin inject v0.1
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] init() method not found in letsencrypt, skipped execution
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] init() method not found in badbehavior, skipped execution
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Successfull init() call for plugin blacklist : successfully loaded 2802 bad IP/network/rDNS/ASN/User-Agent/URI
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Successfull init() call for plugin bunkernet : successfully connected to the BunkerNet service https://api.bunkerweb.io with machine ID e52183c4-c766-4962-a34d-3e37ea6a3e96 and 0 bad IPs in database
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Successfull init() call for plugin whitelist : successfully loaded 0 whitelisted IP/network/rDNS/ASN/User-Agent/URI
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Successfull init() call for plugin dnsbl : successfully loaded 4 DNSBL server(s)
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] init() method not found in country, skipped execution
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Successfull init() call for plugin limit : successfully loaded 2 limit rules for requests
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Successfull init() call for plugin antibot : no service uses Antibot, skipping init
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require redirect : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require ui : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require realip : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require reverseproxy : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require php : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require modsecurity : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require brotli : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] Successfull init() call for plugin errors : success
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require jobs : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require customcert : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require misc : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require authbasic : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require gzip : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require headers : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require selfsigned : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require clientcache : not found
mybunker_1                | 2022/08/04 00:42:01 [info] 19#19: [INIT] can't require inject : not found
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: [INIT] Init phase ended
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: using the "epoll" event method
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: start worker processes
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: start worker process 91
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: start cache manager process 92
mybunker_1                | 2022/08/04 00:42:01 [notice] 19#19: start cache loader process 93
mybunker_1                | 2022/08/04 00:42:02 [notice] 19#19: signal 17 (SIGCHLD) received from 89
mybunker_1                | 2022/08/04 00:42:02 [notice] 56#56: gracefully shutting down
mybunker_1                | 2022/08/04 00:42:02 [notice] 56#56: exiting
mybunker_1                | 2022/08/04 00:42:02 [notice] 56#56: exit
mybunker_1                | 2022/08/04 00:42:02 [notice] 19#19: signal 17 (SIGCHLD) received from 56
mybunker_1                | 2022/08/04 00:42:02 [notice] 19#19: worker process 56 exited with code 0
mybunker_1                | 2022/08/04 00:42:02 [notice] 19#19: signal 29 (SIGIO) received
mybunker_1                | 2022/08/04 00:42:16 [info] 91#91: *14 SSL_do_handshake() failed (SSL: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:SSL alert number 46) while SSL handshaking, client: 158.181.76.197, server: 0.0.0.0:8443
mybunker_1                | 2022/08/04 00:42:46 [info] 91#91: *18 SSL_do_handshake() failed (SSL: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:SSL alert number 46) while SSL handshaking, client: 158.181.76.197, server: 0.0.0.0:8443
mybunker_1                | 2022/08/04 00:43:01 [notice] 93#93: http file cache: /opt/bunkerweb/tmp/proxy_cache 0.000M, bsize: 4096
mybunker_1                | 2022/08/04 00:43:01 [notice] 19#19: signal 17 (SIGCHLD) received from 93
mybunker_1                | 2022/08/04 00:43:01 [notice] 19#19: cache loader process 93 exited with code 0
mybunker_1                | 2022/08/04 00:43:01 [notice] 19#19: signal 29 (SIGIO) received
mybunker_1                | 2022/08/04 00:43:16 [info] 91#91: *22 SSL_do_handshake() failed (SSL: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:SSL alert number 46) while SSL handshaking, client: 158.181.76.197, server: 0.0.0.0:8443
mybunker_1                | 2022/08/04 00:43:20 [notice] 91#91: *23 "^(GET|POST|HEAD)$" does not match "OPTIONS", client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [ACCESS] Skipped access phase because request is internal, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] Log phase started while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] log() method not found in letsencrypt, skipped execution while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] Executing log() of badbehavior while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] Return value from badbehavior.log() is : not increasing counter while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] log() method not found in blacklist, skipped execution while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] Executing log() of bunkernet while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] Return value from bunkernet.log() is : ip is not blocked while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] log() method not found in whitelist, skipped execution while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] log() method not found in dnsbl, skipped execution while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] log() method not found in country, skipped execution while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] log() method not found in limit, skipped execution while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] log() method not found in antibot, skipped execution while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] log() method not found in errors, skipped execution while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | 2022/08/04 00:43:20 [info] 91#91: *23 [LOG] Log phase ended while logging request, client: 158.181.76.197, server: api2.magic-mondrian.art, request: "OPTIONS /login HTTP/2.0", host: "api2.magic-mondrian.art", referrer: "https://www.magic-mondrian.art/"
mybunker_1                | api2.magic-mondrian.art 158.181.76.197 - - [04/Aug/2022:00:43:20 +0000] "OPTIONS /login HTTP/2.0" 200 6115 "https://www.magic-mondrian.art/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
amrap030 commented 2 years ago

Okay, I think I found the fix. Adding this - "bunkerweb.ALLOWED_METHODS=GET|POST|HEAD|OPTIONS" to the environment variables seems to work.

fl0ppy-d1sk commented 2 years ago

Hello @amrap030,

Please note that BW now supports CORS out of the box since the 1.4.3 version. More info here : https://docs.bunkerweb.io/1.4/security-tuning/#cors