The following nginx config serves http://alpha.mydomain/mypath/test
fine, however fails on http://alpha.mydomain/mypath/test/
with 500 Internal Server Error. Notice the slash in the end of the second URL.
The app is HTML5 application therefore the intent is to serve index.html for all /mypath/ paths and let the client side handle the logic.
server {
listen *:80;
server_name alpha.mydomain.com beta.mydomain.com;
location ~ ^/mypath/.*$ {
default_type text/html; # fix for octet stream coming back sometimes
alias /home/ubuntu/myproject-web/index.html;
add_header Content-Type text/html;
}
location / {
alias /home/ubuntu/myproject-web/;
}
}