🚨 Help Needed: #CORS and #Cloudflare Access Issues with #Nextflux + #MiniFlux Setup 🚨

Hi everyone! I’m struggling with a #SelfHosted setup and could really use some advice from the self-hosting community. Lol I've been trying to figure this out for hours with no luck. Here’s my situation:

Setup

  • MiniFlux: Running in #Docker on a #RaspberryPi500 (#Stormux, based on #ArchLinuxARM).
  • Nextflux: Hosted on Cloudflare Pages.
  • Reverse Proxy: #Caddy (installed via AUR).
  • Cloudflare Access: Enabled for security and SSO.
  • Cloudflared: Also installed via AUR.
  • CORS Settings in Cloudflare Access: Configured to allow all origins, methods, and headers.

What’s Working

  • MiniFlux is accessible from my home network after removing restrictive CORS settings in both Caddy and MiniFlux.
  • Nextflux is properly deployed on Cloudflare Pages.

The Problem

Nextflux cannot connect to MiniFlux due to persistent CORS errors and authentication issues with Cloudflare Access. Here are the errors I’m seeing in the browser console:

  • CORS Error:Access to fetch at 'https://rss.laniecarmelo.tech/v1/me' from origin 'https://nextflux.laniecarmelo.tech' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • Cloudflare Access Redirection:

    Request redirected to 'https://lifeofararebird.cloudflareaccess.com/cdn-cgi/access/login/rss.laniecarmelo.tech'.
  • Failed to Fetch:

    Failed to fetch: TypeError: Failed to fetch.
  • What I’ve Tried

  • Service Token Authentication:

    • Generated a service token in Cloudflare Access for Nextflux.
    • Added CF-Access-Client-Id and CF-Access-Client-Secret headers in Caddy for rss.laniecarmelo.tech.
    • Updated Cloudflare Access policies to include a bypass rule for this service token.
  • CORS Configuration:

    • Tried permissive settings (Access-Control-Allow-Origin: *) in both Caddy and MiniFlux.
    • Configured Cloudflare Access CORS settings to allow all origins, methods, and headers.
  • Policy Adjustments:

    • Created a bypass policy for my home IP range and public IP.
    • Added an "Allow" policy for authenticated users via email/login methods.
  • Debugging Logs:

    • Checked Cloudflared logs, which show requests being blocked due to missing access tokens (AccessJWTValidator errors).
  • Current State

    Despite these efforts:

    • Requests from Nextflux are still being blocked by Cloudflare Access or failing due to CORS issues.
    • The browser console consistently shows "No 'Access-Control-Allow-Origin' header" errors.

    Goals

  • Allow Nextflux (hosted on Cloudflare Pages) to connect seamlessly to MiniFlux (behind Cloudflare Access).
  • Maintain secure access to MiniFlux for other devices (e.g., my home network or mobile devices).
  • My Environment

    • Raspberry Pi 500 running Arch Linux ARM.
    • Both Caddy and Cloudflared are installed via AUR packages.
    • MiniFlux is running in Docker with the following environment variables:CLOUDFLARE_SERVICE_AUTH_ENABLED=trueCLOUDFLARE_CLIENT_ID=<client-id>CLOUDFLARE_CLIENT_SECRET=<client-secret>

    Relevant Logs

    From cloudflared:

    ERR error="request filtered by middleware handler (AccessJWTValidator) due to: no access token in request"

    From the browser console:

    Access to fetch at 'https://rss.laniecarmelo.tech/v1/me' has been blocked by CORS policy.

    Questions

  • Is there a better way to configure CORS for this setup?
  • Should I be handling authentication differently between Nextflux and MiniFlux?
  • How can I ensure that requests from Nextflux include valid access tokens?
  • Any help or advice would be greatly appreciated! 🙏

    #SelfHosting #Cloudflare #CaddyServer #Docker #RSS #CORS #Linux #ArchLinuxARM #CloudflarePages #tech #technology

    #開源分享 📰Nextflux 使用 React + Vite 構建的 Miniflux 現代 RSS 閱讀器用戶端
    github.com/electh/nextflux
    💬FlowDown 一款用於使用 AI/LLM 的快速流暢的用戶端應用程式
    github.com/Lakr233/FlowDown-Beta
    🔎QwenLM OCR 對 QwenLM 的 OCR 功能進行逆向工程,提取文字內容,支持CF Workers部署
    github.com/Cunninger/ocr-based-qwen

    #Nextflux #FlowDown #QwenLMOCR