title: 404 page not found when a url is hit but properly served when opened from the link on index page
body: <p>I am using <code>nginx-lua</code> module with <code>redis</code> to serve static files of <code>ember-app</code>. The <code>index</code> file content is stored in <code>redis</code> as a <code>value</code> which is being properly served by <code>nginx</code> when the (root) <code>domain/IP</code> is hit. </p>
  
  <p>If <code>login</code> page is open from link, it gets opened properly. But when opened directly by hitting the url bar or refreshing the page the nginx gives <code>404 not found</code>. 
  The <code>index</code> file is in <code>redis</code> and rest of the files are being served from compiled <code>js</code> which is present on a <code>CDN</code>.
  Following is the nginx configuration</p>
  
  <pre><code>server
  {
    listen 80 ;
    server_name 52.74.57.154;
  
    root /;
  
   default_type   text/html;
   location = / {
      try_files $uri $uri/ /index.html?/$request_uri;
      set_unescape_uri $key $arg_index_key;
      set $fullkey 'ember-deploy-cli:index:${key}';
  
       content_by_lua '
                  local redis = require "resty.redis"
                  local red = redis:new()
  
                  red:set_timeout(1000) -- 1 sec
  
  
  
                  local ok, err = red:connect("127.0.0.1", 6379)
                  if not ok then
                      ngx.say("failed to connect: ", err)
                      return
                  end
  
  
          if ngx.var.key == "" then
              --ngx.say("No Argument passed")
              local res, err = red:get("ember-deploy-cli:index:current-content")
              ngx.say(res)
              return
          end
          local res, err = red:get(ngx.var.fullkey)
  
          if res == ngx.null then
              ngx.say("Key doesnt exist ")
              return
          end
          ngx.say(res)
  
       ';
   }
  </code></pre>