Point angular app on subdomain to subfolder with nginx Point angular app on subdomain to subfolder with nginx nginx nginx

Point angular app on subdomain to subfolder with nginx


Specifying base-href is only needed for the router if your app is not served from the root location, e.g. http://example.com/sub

In your case, you added nginx rules so that content can be served from a sub folder, but using a "root" location (http://sub.example.com)

So from an angular point of view, everything is like it's served from a root folder, meaning there is no need to specify base-href


I had that problem when I was implementing internationalization of Angular application that needed to be served from different sub-directories for each language. Check my solution on the topic.