The following code is run from my controller and causes a 502 error bad gateway on one server. I have been unable to reproduce on my server. What are some causes of 502 Bad Gateway?
function index()
{
$this->_reload();
}
function _reload($data=array())
{
$person_info = $this->Employee->get_logged_in_employee_info();
$data['cart']=$this->sale_lib->get_cart();
$data['modes']=array('sale'=>$this->lang->line('sales_sale'),'return'=>$this->lang->line('sales_return'));
$data['mode']=$this->sale_lib->get_mode();
$data['items_in_cart'] = $this->sale_lib->get_items_in_cart();
$data['subtotal']=$this->sale_lib->get_subtotal();
$data['taxes']=$this->sale_lib->get_taxes();
$data['total']=$this->sale_lib->get_total();
$data['items_module_allowed'] = $this->Employee->has_permission('items', $person_info->person_id);
$data['comment'] = $this->sale_lib->get_comment();
$data['email_receipt'] = $this->sale_lib->get_email_receipt();
$data['payments_total']=$this->sale_lib->get_payments_total();
$data['amount_due']=$this->sale_lib->get_amount_due();
$data['payments']=$this->sale_lib->get_payments();
$data['payment_options']=array(
$this->lang->line('sales_cash') => $this->lang->line('sales_cash'),
$this->lang->line('sales_check') => $this->lang->line('sales_check'),
$this->lang->line('sales_giftcard') => $this->lang->line('sales_giftcard'),
$this->lang->line('sales_debit') => $this->lang->line('sales_debit'),
$this->lang->line('sales_credit') => $this->lang->line('sales_credit')
);
$customer_id=$this->sale_lib->get_customer();
if($customer_id!=-1)
{
$info=$this->Customer->get_info($customer_id);
$data['customer']=$info->first_name.' '.$info->last_name;
$data['customer_email']=$info->email;
}
$data['payments_cover_total'] = $this->_payments_cover_total();
$this->load->view("sales/register",$data);
}
It seems setcookie was being called too much was caused the 502 error. I am not sure if NGNIX was a limit, but this solved the problem.
It's an NGINX/CI problem, if you can't change the settings then changing the session to database worked for me
$config['sess_use_database'] = TRUE;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With