diff --git a/.env.local b/.env.local
index bd28e8f..9575ef8 100644
--- a/.env.local
+++ b/.env.local
@@ -11,4 +11,5 @@ NEXT_SOCIAL_TWITTER="https://twitter.com/user" # I dont h
NEXT_SOCIAL_GITHUB_STATE="true" # I Have GitHub so this is True (if you dont then set this to false) #
NEXT_SOCIAL_GITHUB_LINK_IF_TRUE="http://github.com/ZockerKatze" # If you have GitHub then paste your link here #
NEXT_SOCIAL_BUYMEACOFFEE="https://coff.ee/rattatwinko"
-PORT=8080 # This is unused. You can safely delete if you want. #
\ No newline at end of file
+PORT=8080 # This is unused. You can safely delete if you want. #
+BASE_URL=/blog # This is the subpath!
\ No newline at end of file
diff --git a/README.md b/README.md
index 965c27f..0188736 100644
--- a/README.md
+++ b/README.md
@@ -500,4 +500,26 @@ For issues and questions, please check the project structure and API documentati
- **๐ Force Reparse Button**: One-click cache clearing and post reparsing
- **๐ Enhanced Rust Status**: Real-time parser performance monitoring
- **๐ Improved Log Management**: Better filtering and search capabilities
-- **๐ Directory Health Monitoring**: Comprehensive file system diagnostics
\ No newline at end of file
+- **๐ Directory Health Monitoring**: Comprehensive file system diagnostics
+
+## Configuring a Base URL for Proxy Hosting
+
+If you want to host your app behind a subpath (e.g. `http://localhost:3000/blog/`), set the base URL in `.env.local`:
+
+```
+BASE_URL=/blog
+```
+
+This will automatically prefix all internal links, API calls, and static assets with `/blog`. Make sure your reverse proxy (e.g. nginx) is configured to forward requests from `/blog` to your app.
+
+### Example nginx config
+
+```
+location /blog/ {
+ proxy_pass http://localhost:3000/blog/;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+}
+```
\ No newline at end of file
diff --git a/electron/main.js b/electron/main.js
index 471c826..bf6b674 100644
--- a/electron/main.js
+++ b/electron/main.js
@@ -21,7 +21,9 @@ function createWindow() {
// Load the Next.js app
if (isDev) {
- mainWindow.loadURL('http://localhost:3000');
+ const baseUrl = process.env.BASE_URL || '';
+ const url = `http://localhost:3000${baseUrl}`;
+ mainWindow.loadURL(url);
mainWindow.webContents.openDevTools();
} else {
mainWindow.loadFile(path.join(__dirname, '../.next/server/pages/index.html'));
diff --git a/next.config.js b/next.config.js
index d68bd34..4cf6a7f 100644
--- a/next.config.js
+++ b/next.config.js
@@ -7,6 +7,10 @@ const nextConfig = {
experimental: {
serverComponentsExternalPackages: ['chokidar']
},
+ basePath: process.env.BASE_URL || '',
+ env: {
+ NEXT_PUBLIC_BASE_URL: process.env.BASE_URL || '',
+ },
// Handle API routes that shouldn't be statically generated
async headers() {
return [
diff --git a/posts/about.md b/posts/about.md
index a7ac660..70228d8 100644
--- a/posts/about.md
+++ b/posts/about.md
@@ -6,35 +6,4 @@ author: rattatwinko
summary: This is the about page
---
-# About Me
-
-_**I am rattatwinko**_
-
-I created this Project because of the lack of Blog's that use Markdown.
-It really is sad that there are so many blog platforms which are shit.
-
-## What I used:
-- TypeScript
-- Next.JS
-- Rust
-- Monaco (for a beautiful Editing experience)
-- More shit which you can check out in the Repo
-
-## What I do
-
-School.
-Coding.
-Not more not less.
-
-### Socials
-
-
-
-
-
-
-
+_**config this in the monaco editor in the admin panel**_
diff --git a/posts/welcome.md b/posts/welcome.md
index cc7acd3..964acb1 100644
--- a/posts/welcome.md
+++ b/posts/welcome.md
@@ -535,3 +535,9 @@ If you have seen this is not very mindfull of browser resources tho.
> *"DEVELOPERS! DEVELOPERS! DEVELOPERS!"* - Steve Ballmer
>
> โ Rattatwinko, 2025 Q3
+
+## Hosting behind a subpath (nginx proxy)
+
+If you want to serve your blog at a subpath (e.g. `/blog`), set `BASE_URL=/blog` in your `.env.local` file. All internal links and API calls will use this base path automatically.
+
+Example: Your blog will be available at `http://localhost:3000/blog`
diff --git a/src/app/AboutButton.tsx b/src/app/AboutButton.tsx
index 760f1d6..857c1ec 100644
--- a/src/app/AboutButton.tsx
+++ b/src/app/AboutButton.tsx
@@ -1,6 +1,7 @@
'use client';
import BadgeButton from './BadgeButton';
import { useRouter } from 'next/navigation';
+import { withBaseUrl } from '@/lib/baseUrl';
const InfoIcon = (