homelegance-chat.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Apache Virtual Host — Homelegance Chatbot
  2. # Place at: /etc/httpd/conf.d/homelegance-chat.conf
  3. # Reload: sudo systemctl reload httpd
  4. <VirtualHost *:80>
  5. ServerName chat.homelegance.com
  6. Redirect permanent / https://chat.homelegance.com/
  7. </VirtualHost>
  8. <VirtualHost *:443>
  9. ServerName chat.homelegance.com
  10. SSLEngine on
  11. SSLCertificateFile /etc/ssl/certs/homelegance.crt
  12. SSLCertificateKeyFile /etc/ssl/private/homelegance.key
  13. Header always set X-Content-Type-Options nosniff
  14. Header always set X-Frame-Options SAMEORIGIN
  15. Header always set Referrer-Policy strict-origin-when-cross-origin
  16. # Static files served directly by Apache
  17. DocumentRoot /redant/web/homelegance-chatbot/dist/public
  18. <Directory /redant/web/homelegance-chatbot/dist/public>
  19. Options -Indexes
  20. AllowOverride None
  21. Require all granted
  22. </Directory>
  23. # API requests proxied to Node.js
  24. ProxyPreserveHost On
  25. ProxyPass /api http://127.0.0.1:3000/api
  26. ProxyPassReverse /api http://127.0.0.1:3000/api
  27. # SPA fallback — non-file requests return index.html
  28. RewriteEngine On
  29. RewriteCond %{REQUEST_URI} !^/api/
  30. RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
  31. RewriteRule ^ /index.html [L]
  32. ErrorLog /var/log/httpd/homelegance-chat-error.log
  33. CustomLog /var/log/httpd/homelegance-chat-access.log combined
  34. </VirtualHost>