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

General discussions around KeyHelp.
Post Reply
User avatar
Natig
Posts: 11
Joined: Thu 29. Dec 2022, 10:07

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

Post 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
Last edited by Natig on Thu 29. Dec 2022, 20:03, edited 2 times in total.
User avatar
Florian
Keyweb AG
Posts: 1243
Joined: Wed 20. Jan 2016, 02:28

Re: How to redirect subdomain to server local port?

Post 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
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
Natig
Posts: 11
Joined: Thu 29. Dec 2022, 10:07

Re: How to redirect subdomain to server local port?

Post by Natig »

Thanks a lot, everything worked great.
Post Reply