Deploying Angular Universal in Apache Deploying Angular Universal in Apache apache apache

Deploying Angular Universal in Apache


You can map apache server with pm2 server:

Default Config File: /etc/httpd/conf/httpd.conf

ProxyPass         /example  http://xx.xx.xx.xx:xx/ProxyPassReverse  /example  http://xx.xx.xx.xx:xx/

This will route all request from apache server to your pm2 server


We are using pm2 ecosystem to point localhost

First enable mod_proxy and mod_proxy_http in httpd.conf!

If you are using virtual host add the following proxy setting to your domain-specific host file-

ProxyPreserveHost OnProxyPass / http://localhost:4200/ProxyPassReverse / http://localhost:4200/

Restart your Apache and pm2

So if you accessing your live domain e.g www.example.com will serve by pm2 through localhost:4200