Traccar with ngnix and ssl

Raj5 years ago

Hi Team,

Could anyone assist me to setup traccar with ngnix and ssl. The traccar server will be behind pfsense firewall and the firewall is rinning haproxy.
I am willing to get a beer for any help.

regards,

rajbps

Raj5 years ago

The base server is centos7

Ernesto Vallejo5 years ago

This post should have been created at server section. I would recommend you buy paid services from @Anton. Its money very well invested.

trackinguser4455 years ago

Raj: give more details are you on premise? cloud?

Raj5 years ago

its on premise

what other details you need please?

trackinguser4455 years ago

lets get on a IM of sort

Raj5 years ago

Hi Team,

Got traccar to work with apache, centos7

here are the details and hope this can help someone else

Traccar with centos7 and reverse apache2 proxy

#yum install httpd
#systemctl enable httpd
#systemctl start httpd
#firewall-cmd --permanent --zone=public --add-service=https
#firewall-cmd --reload
#vi /etc/httpd/conf.d/default-site.conf
<IfModule mod_ssl.c>
        <VirtualHost _default_:443>

                ServerName yourservernamehere
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/html

                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
                SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
                SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

        </VirtualHost>
</IfModule>
#systemctl restart httpd
#yum install mod_ssl

Now for a self signed cert

#mkdir /etc/ssl/private
#chmod 700 /etc/ssl/private
#sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

#systemctl restart httpd.service