Tell me the solution to the problem - Architecture: nginx -> apache
I authorize via ajax to the login.php script, after successful authorization, the login.php script should set up cookies and sessions, but they are not set, there are no errors in the nginx and apache logs. In cookies I prescribe a domain and path.
Конфиг nginx # Перенаправление на back-end location / { proxy_pass http://192.168.10.80:8080/www2/public/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_connect_timeout 120; proxy_send_timeout 120; proxy_read_timeout 180; } I use Codeigniter framework, login.php code
$this->CI->input->set_cookie(array( 'name' => 'auth', 'value' => $data, 'expire' => $ttl )); $newdata = array( 'name' => 'auth', 'value' => $data, 'logged_in' => TRUE ); $this->CI->session->set_userdata($newdata);