title: Laravel 502 Proxy Error on specific route call
body: <p>I am having a problem specific to the production code. On said server, everytime I try to access specific route which is supposed to show a table of all categories I get a 502 Proxy Error:</p>
  <pre><code>Proxy Error
  The proxy server received an invalid response from an upstream server.
  The proxy server could not handle the request
  
  Reason: Error reading from remote server
  </code></pre>
  <p>I have found some common problem on the internet already, however all of those were for users who use nginx. I use Laragon. Also, Laravel version is 5.5.21</p>
  <p>As I said the problem is production code only. It is not happening when I run it locally.</p>
  <p>I also tried to download laravel.log file from the server, but there was nothing there.</p>
  <p>This is the function that is being called by route:</p>
  <pre><code>public function index(){
          if(empty(request()-&gt;query()) &amp;&amp; session()-&gt;exists('categories_filter')){
              return redirect(route('categories.index').'?'.http_build_query(session()-&gt;pull('categories_filter')));
          }
  
          if(!empty(request()-&gt;query())){
              $this-&gt;store_filter();
          }
  
          $categories = Category::orderBy($this-&gt;sort, $this-&gt;order);
  
          if($name_sk = request('name_sk')){
              $categories = $categories-&gt;where('name_sk', 'like', &quot;%{$name_sk}%&quot;);
          }
  
          $categories = $categories-&gt;paginate(20);
          $all_categories = Category::with('children')-&gt;get();
  
          $sort = $this-&gt;sort;
          $order = $this-&gt;order;
          $new_order = $this-&gt;new_order;
  
          return view('admin.categories.index', compact('categories', 'sort', 'order', 'new_order', 'all_categories'));
      }
  </code></pre>
  <p>I honestly have no idea where the problem lies or what is its cause.</p>