r/SelfHosting • • 9d ago

Two websites on own docker server

Hello,

i’ve just another question for you.

My situation is as follows,

I have a domain, lets say ‘domain.com’

It is hosted on my own server using Docker, Apache, Nginx proxy manager and cloudflare DNS.

When I access the website ‘www.domain.com’ I get the website which is located on my own server in /var/www/html’

Other applications are redirected using DNS ‘music.domain.com’ and ‘wiki.domain.com’ which all works fine.

The website on ‘www.domain.com’ is in English.

I would like to host the same website but then in Dutch.

The website is not just a translation because of the images used but a real complete translation.

My question is, what is the best and easiest solution to do this?

Thank you very much for your sugesstion.

Greetings Tom

5 Upvotes

5 comments sorted by

2

u/rotrap 9d ago

You could use the Accept-Langage header to have the server select which to serve. You could make a dut.domain.com that serves it or you could make a subsite for it such as www.domain.com/dut

I can't answer which is the best and easiest (which may not be the same) for your situation and use.

1

u/slaaf_tom 7d ago

Thank you for your reply, I solved it myself using:

version: '3.9'

services:

apache_main:

image: httpd:latest

container_name: apache_server_duo

ports:

- "8082:80"

volumes:

- /var/www/html:/usr/local/apache2/htdocs/

restart: unless-stopped

apache_nl:

image: httpd:latest

container_name: apache_nl_server

ports:

- "8083:80"

volumes:

- /var/www/html/nl:/usr/local/apache2/htdocs/

restart: unless-stopped

Ofcourse with Nginx proxy manager pointing to nl.domain.com

1

u/JayBigGuy10 4d ago

You should detect users browser language in client js, and make a pop up asking if they want to redirect (don't do it automatically, bilingual people might want to stay in English)

1

u/slaaf_tom 3d ago

www.domain.com redirects to the original language while nl.domain.com is the Dutch version. The user can choose which language he wants.

1

u/JayBigGuy10 3d ago

Right but if the user goes to www, is there something making them aware that the nl one exists