I am trying to get AngularDart to work with nginx. The compiled files from AngularDart are located at /home/user/project/build
.
If my nginx configuration looks as follows, everything works fine when I open up my browser at www.example.com
:
location / {
alias /home/user/project/build/;
}
However, if I change it to
location /static {
alias /home/user/project/build/;
}
and enter www.example.com/static
in my browser, the browser console says that it could not find lots of scripts, for example http://www.example.com/packages/angular/src/core/zone/ng_zone.ddc.js
. The correct URL of this one would be http://www.example.com/static/packages/angular/src/core/zone/ng_zone.ddc.js
.
Any ideas how I can get the dart compiler to add /static
to the URLs so that it works?
You'll need to set the base href.
To do so, add the following tag into your index.html
file
<base href="/static">
You can find more info on this in the documentation