title: Nginx "No such file or directory error" for existing file path with appropriate permissions
body: <p>When attempting to view the HLS stream being sent from OBS to Nginx, I keep getting the error: </p>
  
  <p><code>33 open() "/usr/share/nginx/html/HLS/live/5cc56be78cea0.m3u8" failed (2: No such file or directory)</code></p>
  
  <p>but the path <code>/usr/share/nginx/html/HLS/live/</code> DOES exist (the stream file is also created) and I double checked the folder permissions</p>
  
  <p>My Nginx config server block is:</p>
  
  <pre><code>server {
  
      listen 444 ssl;
      listen [::]:444 ssl;
  
      ssl_certificate /etc/ssl/certs/concartcert.crt;
      ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;                    
  
      server_name 129.567.55.36;
  
      location /live {
          # Disable cache
          add_header 'Cache-Control' 'no-cache';
  
          # CORS setup
          add_header 'Access-Control-Allow-Origin' '*' always;
          add_header 'Access-Control-Expose-Headers' 'Content-Length';
  
          # allow CORS preflight requests
          if ($request_method = 'OPTIONS') {
              add_header 'Access-Control-Allow-Origin' '*';
              add_header 'Access-Control-Max-Age' 1728000;
              add_header 'Content-Type' 'text/plain charset=UTF-8';
              add_header 'Content-Length' 0;
              return 204;
          }
          types {
              application/vnd.apple.mpegurl m3u8;
          }
          alias /usr/share/nginx/html/HLS/live;
      }
      # allows us to see how stats on viewers on our Nginx site using a URL like: "http://my-ip/stats"     
      # location /stats {
          # stub_status;
      # }
      location /stat {
          rtmp_stat all;
          rtmp_stat_stylesheet stat.xsl;
      }
      location /stat.xsl {
          root html;
      }
      location /control {
          rtmp_control all;
      }
      # allows us to host some webpages which can show our videos: "http://my-ip/my-page.html"     
      location / {
          root   html;
          index  index.html index.htm;
      }   
  }
  </code></pre>
  
  <p>Could anyone help my identify the possible cause of the error. Checking online, the two possible causes identified were the folder permissions or the folder path but after checking both I am lost on how to proceed.</p>