Traccar with SSL

Turbovix4 years ago

Claudio, delete that line:

           ServerAlias ​​www.login.cloudgps.site
Claudio Carrasco4 years ago

Thanks Turbovix, now my traccar.conf is

<IfModule mod_ssl.c>
          <VirtualHost _default_:80>
               ServerName login.cloudgps.site
               Redirect / https://login.cloudgps.site
         </VirtualHost>
         <VirtualHost _default_:443>
                ServerName login.cloudgps.site
                ServerAdmin ***@gmail.com
                ProxyPass /api/socket ws://localhost:8082/api/socket
                ProxyPassReverse /api/socket ws://localhost:8082/api/socket
                ProxyPass / http://localhost:8082/
                ProxyPassReverse / http://localhost:8082/
                SSLEngine on
                Include /etc/letsencrypt/options-ssl-apache.conf
                SSLCertificateFile /etc/letsencrypt/live/login.cloudgps.site/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/login.cloudgps.site/privkey.pem
        </VirtualHost>
</IfModule>

the "ERR_TOO_MANY_REDIRECTS" error keeps popping up. The funny thing is that every time I update the browser, the address appears once with "https:" and once without "https:" in the address bar. The rewrite modeule is already enabled.

I don't know where is the problem :( thank you very much for your help!

Anton Tananaev4 years ago

Try clearing browser cache. Maybe you had wrong redirect before and it got cached.

Claudio Carrasco4 years ago

Thanks Anton,

I always clear the browser cache when I make any changes.

The problem persists.

Greetings!

Anton Tananaev4 years ago

To be absolutely sure, I would recommend trying in Chrome with "disable cache" option in developer tools. You can also tick "preserve log" checkbox and inspect all network requests.

There must be redirect somewhere.

Claudio Carrasco4 years ago

I do that,

ScreenShot

I don't know where is the problem :(

Anton Tananaev4 years ago

Have you inspected the calls? Specifically HTTPS > HTTP redirect.

Claudio Carrasco4 years ago

I see that the site redirects from http to https, then from https to http and repeats the process infinitely.

Anton Tananaev4 years ago

Looks like you are using CloudFlare, which is probably where your misconfiguration is. The issue is clearly not on the server itself. Next time you should also probably provide all the context, like the fact that you are using CloudFlare proxy. It will save everyones time.

Claudio Carrasco4 years ago

Oh I'm sorry! Yes, I forgot to say, I am using cloudflare and disabled SSL / TLS encryption.

Do I have to enable it?

Anton Tananaev4 years ago

Disable CloudFlare proxy!!!

Claudio Carrasco4 years ago

Thanks Anton, it works!! you are the best!!!

Thanks Turbovix!!

:D

Josea year ago

I followed all the instructions for the secure connection, and the certificate was installed! but when I log into the browser it tells me:

Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.4.55 (Ubuntu) Server at mydomain.com Port 443

Anton Tananaeva year ago

That probably means your Traccar server is down.

Wandersona year ago

I have 2 servers and I was able to activate ssl without any problems following the documentation step by step, Ubuntu 22.04 and Ubuntu 20.04.