Server side rendering using Angular 5 (Angular Universal) page source is not updating

旧时模样 提交于 2019-12-04 18:35:11

View Page Source shows originally loaded HTML, later DOM is modified by angular, but it has no effect on originally loaded HTML.

I recently had this problem too. It was something to do with the server proxy on an Apache server not rendering pages on other urls. However, everything was working on my localhost server.

example.com (rendering)
example.com/faq (rendering)
example.com/faq/general (not rendering)

If you are using Apache, configure your proxy settings in your virtualhost file

<VirtualHost *:80>
 ServerName example.com
 DocumentRoot /your/apache/files/htdocs

 ProxyRequests Off
 ProxyPreserveHost On
 ProxyVia Full
 <Proxy *>
  Require all granted
 </Proxy>

<Location /*>
      ProxyPass http://127.0.0.1:3000
      ProxyPassReverse http://127.0.0.1:3000
</Location>
<Location /faq/*>
      ProxyPass http://127.0.0.1:3000
      ProxyPassReverse http://127.0.0.1:3000
</Location>

</VirtualHost>

Restart your server and it should come up on your view page source.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!