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