{"timestamp": "2026-07-10T22:16:11.139234", "data": {"url": "https://stackoverflow.com/questions/70936538/caddyfile-how-to-run-multiple-listeners-under-the-same-server", "title": "reactjs - Caddyfile - How to run multiple listeners under the same server? - Stack Overflow", "content": "The 2026 Annual Developer Survey is live\u2014 take the Survey today! Collectives\u2122 on Stack Overflow Find centralized, trusted content and collaborate around the technologies you use most. Learn more about Collectives Stack Internal Knowledge at work Bring the best of human thought and AI automation together at your work. Explore Stack Internal Caddyfile - How to run multiple listeners under the same server? Ask Question Asked 4 years, 5 months ago Modified 2 years, 6 months ago Viewed 3k times 1 I am newbie to Caddy. I have a system that has 2 servers, backend and frontend. The frontend is a React app. I want to use reverse proxies in caddy to direct requests coming from outside to my servers. If I want to run only one server, let's say the frontend, I use a Caddyfile as the following, and it works properly :2020 { reverse_proxy localhost:8092 } i.e. The react app shows properly on the browser at the address: http://localhost:2020/ However, when I use the following Caddyfile :2020 { reverse_proxy /frontend localhost:8092 reverse_proxy /backend localhost:8093 } and try to reach the frontend site, I could see the title on browser's tab, however, the frontend itself won't be loading. I have took a look at the following question Caddyfile Subdomain with Multiple Proxies and tried to follow similar solution, however, that didn't work. So my question is how to implement such a configuration. Edit I just noticed the following: The resources of my UI are loaded as expected using the first Caddyfile , however, they are missing in the second one! Here I would add a second question to my previous one: Why some sources are missed using the second configuration? reactjs reverse-proxy caddy caddyfile Share Improve this question Follow edited Feb 1, 2022 at 14:52 asked Feb 1, 2022 at 6:47 philippos 1,313 6 6 gold badges 28 28 silver badges 47 47 bronze badges Add a comment | 1 Answer 1 Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 0 Does the route of your frontend project contain /frontend , If yes, have you configured routing correctly in your frontend project? :2020 { route /backend/* { reverse_proxy localhost:8093 } route /* { reverse_proxy localhost:8092 } } Share Improve this answer Follow answered Mar 1, 2022 at 9:43 padeoe 752 7 7 silver badges 11 11 bronze badges Sign up to request clarification or add additional context in comments. Your Answer Reminder: Answers generated by AI tools are not allowed due to Stack Overflow's artificial intelligence policy Draft saved Draft discarded Sign up or log in Sign up using Google Sign up using Email and Password Submit Post as a guest Name Email Required, but never shown Post Your Answer Discard By clicking \u201cPost Your Answer\u201d, you agree to our terms of service and acknowledge you have read our privacy policy . Start asking to get answers Find the answer to your question by asking. Ask question Explore related questions reactjs reverse-proxy caddy caddyfile See similar questions with these tags. The Overflow Blog What's left for infrastructure-as-code after AI moves... Building more than just an agent... Featured on Meta Partnering with Communities to Modernize Policies & Norms Policy: Generative AI (e.g., ChatGPT) is banned The 2026 Developer Survey is Live Looking ahead, starting conversations, and seizing the moment Next steps for open-ended questions Visit chat Linked 1 Caddyfile Subdomain with Multiple Proxies Related 4 Caddy server:multiple proxies for same site 4 React JS - Proxy event? 2 running frontend and backend on different ports 9 How to work with two different APIs with React? 13 Specify Caddy listening port 3 Caddy rewrite and redir 6 Nginx reverse proxy and multiple React apps 1 Proxying Multiple API requests with Create React App with React-Scripts version 3.4.1 5 Caddy: How to add multiple reverse proxies via API and not using Caddyfile? 3 Nginx reverse proxy multiple react apps Hot Network Questions Why does Germany have a uniquely difficult driving assessment test for drivers with serious traffic offenses Why was Ecclesiastes kept? How to get tinkagears from Tinkmaster? Converting Current Controlled Switch in PSpice to LTSpice How to find the complete list of possible Attributes? I've hit a wall practicing alone after 8 years of having a teacher, and I need help Infinite chains of subgroups Is \u201cenough!\u201d in Luke 22:38, the correct translation? Statistics: computing confidence intervals where mean and variance are not known, Java - Take II Forming a quadratic equation and solving for x in the following question How can an international postgraduate dental student secure private US student loans without a US cosigner? Help translating calligraphy on two Chinese ink paintings How to make a relatively more beautiful classification table of quadratic functions? Congruences for the permanent of symmetric matrices with even diagonal Thesis requiring proprietary fonts Are the Father and the Son the same entity according to Isaiah and Jesus' statement \"I and the Father are one\"? Are the difficulty of acquiring a driving licence and the proportion of deaths coming from road accidents positively or negatively correlated? How did Krem know kryptonite was Kara's weakness in Supergirl? Shortest proof about intersection property Does Tactical Charge consume the creature's normal movement for the turn? Has this question about writing styles in mathematics as technology advanced been studied? How to efficiently extract mathematical models from engineering literature without getting bogged down in domain details? Which interpretation is correct if goal of our work is to get moksha by Shri Hari Vishnu? Asking suggestion for explaining differences in probability more hot questions Question feed lang-js", "lists": [["About", "Products", "Stack Internal"], ["Stack Internal Implement a knowledge platform layer to power your enterprise and AI tools.", "Stack Data Licensing Get access to top-class technical expertise with trusted & attributed content.", "Stack Ads Connect your brand to the world\u2019s most trusted technologist communities.", "Releases Keep up-to-date on features we add to Stack Overflow and Stack Internal.", "About the company Visit the blog"], ["Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company, and our products", "Tour Start here for a quick overview of the site", "Help Center Detailed answers to any questions you might have", "Meta Discuss the workings and policies of this site", "About Us Learn more about Stack Overflow the company, and our products", "", "current community Stack Overflow help chat Meta Stack Overflow your communities Sign up or log in to customize your list. more stack exchange communities company blog", "Stack Overflow help chat", "Meta Stack Overflow", "", "Log in", "Sign up"], ["Tour Start here for a quick overview of the site", "Help Center Detailed answers to any questions you might have", "Meta Discuss the workings and policies of this site", "About Us Learn more about Stack Overflow the company, and our products"], ["Stack Overflow help chat", "Meta Stack Overflow"], ["Home Questions AI Assist Tags Stack Overflow for Agents Challenges Chat Articles Users Companies Collectives Communities for your favorite technologies. Explore all Collectives", "Home", "Questions", "AI Assist", "Tags", "", "Stack Overflow for Agents", "", "Challenges", "Chat", "Articles", "Users", "", "Companies", "Collectives", "Communities for your favorite technologies. Explore all Collectives", "Stack Internal Stack Overflow for Teams is now called Stack Internal . Bring the best of human thought and AI automation together at your work. Try for free Learn more", "Stack Internal", "Bring the best of human thought and AI automation together at your work. Learn more"], ["Home", "Questions", "AI Assist", "Tags", "", "Stack Overflow for Agents", "", "Challenges", "Chat", "Articles", "Users", "", "Companies", "Collectives", "Communities for your favorite technologies. Explore all Collectives"], ["reactjs", "reverse-proxy", "caddy", "caddyfile"], ["Please be sure to answer the question . Provide details and share your research!"], ["Asking for help, clarification, or responding to other answers.", "Making statements based on opinion; back them up with references or personal experience."], ["reactjs", "reverse-proxy", "caddy", "caddyfile"], ["The Overflow Blog", "What's left for infrastructure-as-code after AI moves...", "Building more than just an agent...", "Featured on Meta", "Partnering with Communities to Modernize Policies & Norms", "Policy: Generative AI (e.g., ChatGPT) is banned", "The 2026 Developer Survey is Live", "Looking ahead, starting conversations, and seizing the moment", "Next steps for open-ended questions"], ["Why does Germany have a uniquely difficult driving assessment test for drivers with serious traffic offenses", "Why was Ecclesiastes kept?", "How to get tinkagears from Tinkmaster?", "Converting Current Controlled Switch in PSpice to LTSpice", "How to find the complete list of possible Attributes?", "I've hit a wall practicing alone after 8 years of having a teacher, and I need help", "Infinite chains of subgroups", "Is \u201cenough!\u201d in Luke 22:38, the correct translation?", "Statistics: computing confidence intervals where mean and variance are not known, Java - Take II", "Forming a quadratic equation and solving for x in the following question", "How can an international postgraduate dental student secure private US student loans without a US cosigner?", "Help translating calligraphy on two Chinese ink paintings", "How to make a relatively more beautiful classification table of quadratic functions?", "Congruences for the permanent of symmetric matrices with even diagonal", "Thesis requiring proprietary fonts", "Are the Father and the Son the same entity according to Isaiah and Jesus' statement \"I and the Father are one\"?", "Are the difficulty of acquiring a driving licence and the proportion of deaths coming from road accidents positively or negatively correlated?", "How did Krem know kryptonite was Kara's weakness in Supergirl?", "Shortest proof about intersection property", "Does Tactical Charge consume the creature's normal movement for the turn?", "Has this question about writing styles in mathematics as technology advanced been studied?", "How to efficiently extract mathematical models from engineering literature without getting bogged down in domain details?", "Which interpretation is correct if goal of our work is to get moksha by Shri Hari Vishnu?", "Asking suggestion for explaining differences in probability"], ["Questions", "Help", "Chat"], ["Stack Internal", "Stack Data Licensing", "Stack Ads"], ["About", "Press", "Work Here", "Legal", "Privacy Policy", "Terms of Service", "Contact Us", "Cookie Settings", "Cookie Policy"], ["Technology", "Culture & recreation", "Life & arts", "Science", "Professional", "Business", "API", "Data"], ["Blog", "Facebook", "Twitter", "LinkedIn", "Instagram"]], "tables": [], "code_blocks": [":2020 {\n        reverse_proxy localhost:8092\n}", ":2020 {\n        reverse_proxy localhost:8092\n}", "http://localhost:2020/", "Caddyfile", ":2020 {\n        reverse_proxy /frontend localhost:8092\n        reverse_proxy /backend localhost:8093\n}", ":2020 {\n        reverse_proxy /frontend localhost:8092\n        reverse_proxy /backend localhost:8093\n}", "Caddyfile", "/frontend", ":2020 {\n        route /backend/* {\n                reverse_proxy localhost:8093\n        }\n        route /* {\n                reverse_proxy localhost:8092\n        }\n}", ":2020 {\n        route /backend/* {\n                reverse_proxy localhost:8093\n        }\n        route /* {\n                reverse_proxy localhost:8092\n        }\n}"], "meta_description": "I am newbie to Caddy.\nI have a system that has 2 servers, backend and frontend.\nThe frontend is a React app.\nI want to use reverse proxies in caddy to direct requests coming from outside to my serv...", "meta_keywords": "", "og_image": "https://stackoverflow.com/Content/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=0f0cab681579", "js_rendered": true, "js_message": "Page appears to be rendered by a JavaScript framework; content may be incomplete.", "success": true, "error": "", "truncated": false, "fetched_bytes": 248784, "total_bytes": null}}