diff --git a/apache-config-example.conf b/apache-config-example.conf index ddc36f5..8bdbee1 100644 --- a/apache-config-example.conf +++ b/apache-config-example.conf @@ -8,15 +8,21 @@ SSLCertificateFile /etc/letsencrypt/live/www.ypchat.net/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/www.ypchat.net/privkey.pem - # DocumentRoot (optional, falls statische Dateien direkt serviert werden sollen) + # DocumentRoot (nur für statische Dateien wie ads.txt) DocumentRoot /opt/ypchat/docroot + # WICHTIG: Deaktiviere DirectoryIndex, damit Apache keine index.html direkt serviert + # Alle Anfragen sollen an Node.js weitergeleitet werden + DirectoryIndex disabled + AllowOverride None Require all granted + # Verhindere, dass Apache index.html automatisch serviert + Options -Indexes - # Spezielle Regel für /ads.txt + # Spezielle Regel für /ads.txt (muss VOR ProxyPass stehen!) Alias /ads.txt /opt/ypchat/docroot/ads.txt Require all granted @@ -34,6 +40,7 @@ RewriteRule ^/?(.*) "ws://localhost:4000/$1" [P,L] # Reverse Proxy zu Node.js + # WICHTIG: ProxyPass muss ALLE Routen abfangen, auch / ProxyPreserveHost On ProxyPass /ads.txt ! ProxyPass / http://localhost:4000/