Simplify Apache config to proxy all requests to Nuxt server
This commit is contained in:
@@ -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/
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
ServerName harheimertc.tsschulz.de
|
||||
ServerAdmin admin@tsschulz.de
|
||||
|
||||
DocumentRoot /var/www/harheimertc/dist
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/harheimertc-ssl-error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/harheimertc-ssl-access.log combined
|
||||
|
||||
@@ -28,25 +26,10 @@
|
||||
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
||||
Header always set Permissions-Policy "geolocation=(), microphone=(), camera=()"
|
||||
|
||||
# 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 (falls Server-Side Rendering verwendet wird)
|
||||
# Proxy alle Anfragen an Nuxt Server (Port 3100)
|
||||
ProxyPreserveHost On
|
||||
ProxyPass /api/ http://localhost:3100/api/
|
||||
ProxyPassReverse /api/ http://localhost:3100/api/
|
||||
ProxyPass / http://localhost:3100/
|
||||
ProxyPassReverse / http://localhost:3100/
|
||||
</VirtualHost>
|
||||
|
||||
# HTTP zu HTTPS Redirect
|
||||
|
||||
Reference in New Issue
Block a user