title: Nginx and angular: Uncaught SyntaxError: Unexpected token <
body: <p>so my problem is, that nginx is apparently not loading all the dependecies for angular defined at the beginning of the .html view.</p>
  
  <p>This is an excerpt from the <code>start_game.html</code></p>
  
  <pre><code>`
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="description" content=""&gt;
      &lt;meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" /&gt;
  
      &lt;!--&lt;link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,400italic'&gt;--&gt;
      &lt;link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,700,700i" rel="stylesheet"&gt;
      &lt;link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"&gt;
      &lt;link rel="stylesheet" href="/../node_modules/angular-material/angular-material.css"/&gt;
      &lt;link rel="stylesheet" href="/../app/assets/app.css"/&gt;
  
      &lt;script src="/../node_modules/angular/angular.js"&gt;&lt;/script&gt;
      &lt;script src="/../node_modules/angular-animate/angular-animate.js"&gt;&lt;/script&gt;
      &lt;script src="/../node_modules/angular-aria/angular-aria.js"&gt;&lt;/script&gt;
      &lt;script src="/../node_modules/angular-environment/dist/angular-environment.js"&gt;&lt;/script&gt;
  
      &lt;script src="/../node_modules/angular-material/angular-material.js"&gt;&lt;/script&gt;
  
  
      &lt;script&gt;
          angular.module("startGame", ['ngMaterial']);
      &lt;/script&gt;
  
      &lt;script src="/start_game.js"&gt;&lt;/script&gt;
  `
  </code></pre>
  
  <p>The <code>nginx.conf</code> file looks like this</p>
  
  <p>`server {
                  # Used to set address and/or port for IP.
                  listen       80;
                  server_name localhost;
                  include       /etc/nginx/mime.types;</p>
  
  <pre><code>            location /console {
                      proxy_pass http://jatos-backend;
              }
  
              # all other traffic
              location / {
                      root /usr/share/nginx/html;
                      try_files $uri /trust/start_game/start_game.html$is_args$args;
                      include /etc/nginx/mime.types;
              }
  
              location /start_game {
                      return 404;
              }
  
      }
  </code></pre>
  
  <p>`</p>
  
  <p>When requesting <code>http://localhost</code> i get the following errors
  <a href="https://i.stack.imgur.com/ZISmY.png" rel="nofollow noreferrer">Console errors</a></p>
  
  <p>but the actual path <code>http://localhost/trust/start_game/start_game.html</code> directly to the view resolves without any issues.</p>
  
  <p>Thank you for your time</p>