Despliegue del Frontend de Angular

3. Configuración Apache2

apt install apache2

a2enmod rewrite

systemctl reload apache2

Rutas Angular (refresh no debe dar 404), lo vemos más adelante, ahora no

Crea el .htaccess en el VPS:

sudo nano /var/www/mi-app/.htaccess

RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]

sudo systemctl restart apache2