Page 1 of 1

How to redirect subdomain to server local port?  [SOLVED]

Posted: Thu 29. Dec 2022, 10:36
by Natig
I installed traccar on GPS server from https://www.traccar.org/install-digitalocean/

how to setup subdomain config to make it work properly

I need to redirect the subdomain like this

https://gps.zaka.biz -> http://server_ip:portnumber/login

Re: How to redirect subdomain to server local port?

Posted: Thu 29. Dec 2022, 10:58
by Florian
Hello,

you must use mod_proxy.

Enable proxy_http module in the Apache Webserver and set the required proxy rules in the tab "apache settings" (use the pencil symbol behind the domain/subdomain name)

e.g.

Code: Select all

 <IfModule mod_proxy.c>
        ProxyPass /.well-known/acme-challenge !
</IfModule>

Alias /.well-known/acme-challenge /home/keyhelp/www/.well-known/acme-challenge

ProxyPass / http://127.0.0.1:Portnumber/
ProxyPassReverse / http://127.0.0.1:Portnumber/


Ther first lines make sure that you can use Let's Encrypt on a domain that uses mod_proxy

Re: How to redirect subdomain to server local port?

Posted: Thu 29. Dec 2022, 12:55
by Natig
Thanks a lot, everything worked great.