Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/693c70a4-9498-8011-87ee-efb5576cc53d
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: You’re right to call that out — and thank you for pasting the actual docker-compose.yml. === You’re right to call that out — and thank you for pasting the actual docker-compose.yml. Let’s align on what you currently have and whether it’s correct. ==== <syntaxhighlight lang="yaml">services: ==== caddy: image: caddy:latest container_name: wsi-caddy restart: unless-stopped expose: * "80" volumes: * ./Caddyfile:/etc/caddy/Caddyfile * ./site:/usr/share/caddy * caddy_data:/data * caddy_config:/config networks: * npm-net networks: npm-net: external: true volumes: caddy_data: caddy_config: </syntaxhighlight> 👉 This is perfectly valid for Option B (NPM as the public reverse proxy) if NPM is on the same Docker host and also attached to <code>npm-net</code>. * expose: "80" means: - Caddy listens on port 80 inside the container. - The port is only visible to other containers on the same Docker network. - It is not published to the host (no 0.0.0.0:PORT mapping). * networks: - npm-net means: - Caddy is joined to the same Docker network where Nginx Proxy Manager should be. - NPM can reach Caddy via Docker DNS name wsi-caddy:80. So: * My earlier suggestion with ports: "8088:80" is one valid pattern (host-port based). * What you have now (expose + shared network) is another valid pattern, and actually cleaner when everything is inside Docker. We just need to wire NPM correctly to this. ==== From VPS shell: ==== # Check that npm-net exists: <syntaxhighlight lang="bash">docker network ls | grep npm-net </syntaxhighlight> # Inspect who is on that network: <syntaxhighlight lang="bash">docker network inspect npm-net | grep Name </syntaxhighlight> You should see something like: * wsi-caddy * npm (your Nginx Proxy Manager container) If both are on npm-net, you’re good. ==== In NPM UI → Hosts → Proxy Hosts → Add Proxy Host: ==== ===== - Domain Names: whitestoneintel.com ===== * Scheme: http * Forward Hostname / IP: wsi-caddy * Forward Port: 80 * Websockets support: ON (safe to enable) * SSL tab: - Request a new SSL certificate (Let’s Encrypt) - Force SSL - HTTP/2 support ON ===== Either: ===== * Create a second Proxy Host: - Domain: www.whitestoneintel.com - Forward: http://wsi-caddy:80 - SSL same as above OR * Configure NPM to redirect www.whitestoneintel.com → whitestoneintel.com. ===== - Domain Names: wsi.whitestoneintel.com ===== * Scheme: http * Forward Hostname / IP: wsi-caddy * Forward Port: 80 * SSL configuration similar to A/B. ==== Because NPM terminates HTTPS, Caddy only has to serve HTTP: ==== <syntaxhighlight lang="caddyfile">:80 { root * /usr/share/caddy file_server } </syntaxhighlight> If you want host-based logic later, you can refine, for example: <syntaxhighlight lang="caddyfile">http://whitestoneintel.com { root * /usr/share/caddy file_server } http://wsi.whitestoneintel.com { root * /usr/share/caddy file_server } </syntaxhighlight> But the simple :80 block is enough for now while NPM does the SNI/host routing. ==== From: ==== <syntaxhighlight lang="bash">cd ~/projects/wsi-website-prod docker compose down docker compose up -d docker logs wsi-caddy --tail 20 </syntaxhighlight> If logs show: * config loaded * listening on :80 * no obvious errors then Caddy is fine. ===== - ✅ Your current docker-compose.yml with expose: "80" is correct for the “NPM as front, Caddy behind” model. ===== * ✅ The key missing piece is just NPM’s Proxy Host pointing to wsi-caddy:80, not to VPS IP + host port. * ✅ No need to change your compose file right now. If you tell me what you currently have set in NPM’s <code>Forward Hostname / IP</code> and Port for whitestoneintel.com, I can adjust it line by line.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)