Web events do not work with https.

compularm4 years ago

Good morning every body.

In the new events panel nothing is shown if I enter through https, however, if I enter through port 8082 it works perfect. I guess it is nginx configuration problem.
Has it happened to someone or do you know how to solve it?
I copy my config file from nginx:

server { 
    listen 80; 
    listen [::]:80;
    server_name miplataforma.xxxxx.com;
     return 301 https://miplataforma.xxxxx.com$request_uri;
}

server { 
    listen 443 ssl; 
    server_name miplataforma.xxxxx.com; 
    ssl_certificate /etc/letsencrypt/live/xxxxx.com/fullchain.pem; 
    ssl_certificate_key /etc/letsencrypt/live/xxxxx.com/privkey.pem; 
    #ssl_session_timeout 5m; 
    #ssl_protocols SSLv2 SSLv3 TLSv1; 
    #ssl_ciphers HIGH:!aNULL:!MD5; 
    #ssl_prefer_server_ciphers on; 

    location / {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_redirect hhtp://localhost:8082/ /;
    proxy_redirect ws://localhost:8082/api/socket /api/socket;
    proxy_pass http://localhost:8082;
    proxy_buffering off;
    proxy_connect_timeout 43200000;
    proxy_send_timeout 43200000;
    proxy_read_timeout 43200;
    allow all;
    #proxy_buffers 8 1024;
    #proxy_buffer_size 1024k;

        root /opt/traccar/web/; 
    index release.html;
    }
}
Damian4 years ago

Hi, this config is working for me. Hope it helps.

...
    server {
      listen 80;

      location /api/socket {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
        proxy_pass http://traccar/api/socket;
      }

      location / {
        proxy_pass http://traccar;
      }
    }
...
compularm4 years ago

muchas gracias por tu respuesta, lo resolví escribiendo la línea:

proxy_http_version 1.1;

Después de los encabezados y antes de la redirección.

Saludos