Simplify Apache config to proxy all requests to Nuxt server

This commit is contained in:
Torsten Schulz (local)
2025-10-21 09:06:07 +02:00
parent 96797909ae
commit e5fa1232ba
2 changed files with 4 additions and 42 deletions

View File

@@ -5,32 +5,11 @@
ServerName harheimertc.tsschulz.de
ServerAdmin admin@tsschulz.de
DocumentRoot /var/www/harheimertc/dist
ErrorLog ${APACHE_LOG_DIR}/harheimertc-error.log
CustomLog ${APACHE_LOG_DIR}/harheimertc-access.log combined
# SPA Fallback für Nuxt.js
<Directory "/var/www/harheimertc/dist">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
# Fallback für Client-Side Routing
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</Directory>
# API-Routes für Nuxt Server
# Proxy alle Anfragen an Nuxt Server (Port 3100)
ProxyPreserveHost On
ProxyPass /api/ http://localhost:3100/api/
ProxyPassReverse /api/ http://localhost:3100/api/
# Fallback für alle anderen Routen (SPA)
ProxyPass / http://localhost:3100/
ProxyPassReverse / http://localhost:3100/