Skip to content

Commit

Permalink
feat: add nginx proxy page for NodeJS
Browse files Browse the repository at this point in the history
  • Loading branch information
mandrasch committed May 20, 2024
1 parent 8cd143c commit 7dfbdd1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
18 changes: 11 additions & 7 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (process.env.BASE_PATH) {

export default defineConfig({
lang: "en-US",
title: "@mandrasch's DDEV Lab",
title: "mandrasch's DDEV Lab",
description:
"This site contains my experimental projects done with the awesome developer environment tool DDEV (Open Source). Authored by Matthias Andrasch.",
lastUpdated: true,
Expand All @@ -26,15 +26,15 @@ export default defineConfig({

head: [
[
'script',
"script",
{
"defer": true,
defer: true,
"data-domain": "my-ddev-lab.mandrasch.eu",
src:"https://plausible.coolify.mandrasch.dev/js/script.js"
}
]
src: "https://plausible.coolify.mandrasch.dev/js/script.js",
},
],
],

themeConfig: {
editLink: {
pattern: "https://github.com/mandrasch/my-ddev-lab/edit/main/docs/:path",
Expand Down Expand Up @@ -129,6 +129,10 @@ function getGeneralSidebar() {
text: "Vite",
link: "/tutorials/nodejs-tools/vite",
},
{
text: "nginx Proxy for Headless CMS",
link: "/tutorials/nodejs-tools/nginx-proxy-headless-cms",
},
{
text: "Other buildtools",
link: "/tutorials/nodejs-tools/laravel-mix-browsersync",
Expand Down
21 changes: 21 additions & 0 deletions docs/tutorials/nodejs-tools/nginx-proxy-headless-cms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
head:
- - meta
- name: description
content: ""
---

# nginx Proxy for Headless CMS

This is an awesome and clean way of using NodeJS and/or PHP in one project within DDEV!

I'm not quite finished adapting this to work with PHP + NodeJS combined in DDEV, but as I heard some people do it this way already.

The NodeJS project will be in a separate subfolder like `frontend/`, php in the main folder. The trick is the [custom nginx configuration for the NodeJS project](https://github.com/mandrasch/ddev-laravel-breeze-sveltekit/blob/main/.ddev/nginx_full/frontend.conf) + the [additional hostname in .ddev/config.yaml](https://github.com/mandrasch/ddev-laravel-breeze-sveltekit/blob/main/.ddev/config.yaml).

- Classic PHP backend (Laravel) with NodeJS frontend (SvelteKit) https://github.com/mandrasch/ddev-laravel-breeze-sveltekit
- Two NodeJS projects within DDEV https://www.lullabot.com/articles/nodejs-development-ddev
- Another guide: Drupal + NextJS
https://www.velir.com/ideas/2024/05/13/how-to-run-headless-drupal-and-nextjs-on-ddev

Thanks very much to Andy Blum for writing https://www.lullabot.com/articles/nodejs-development-ddev!
2 changes: 1 addition & 1 deletion docs/tutorials/nodejs-tools/vite.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ head:
content: ""
---

# Vite
# Vite (in PHP CMS)

NEW: I wrote a detailed guide here: https://ddev.com/blog/working-with-vite-in-ddev/

Expand Down

0 comments on commit 7dfbdd1

Please sign in to comment.