Local dispatcher with DNS name | Adobe Higher Education
Skip to main content
Level 2
March 29, 2022
Répondu

Local dispatcher with DNS name

I want to test local dispatcher configs with domain names. How can I do this using the docker local/dev dispatcher?

 

Right now I have it standing up but looks like all content can be found using localhost:8080/content/<project>/en.html

Instead I want to do something like this: <random_domain>:8080/en.html

 

This is for local environment setup which allows me to test rewrites and such. Not for use on a web host.

 

Ce sujet a été fermé aux réponses.
Meilleure réponse par RikVanBelle

You can't add a port to your host file, but when you run a local dispatcher you use the docker_run.sh with port 80 as parameter.

./docker_run.sh [path-to-dispatcher-src] host.docker.internal:4503 80


Your /etc/hosts file should look like this

127.0.0.1 www.mydomain.com

And your VirtualHost should look like this

 

 

<VirtualHost www.mydomain.com:80>
...
</VirtualHost>

 Now you can go to www.mydomain.com in your browser.

 

1 commentaire

Anish-Sinha
Adobe Employee
Adobe Employee
March 30, 2022

You can do this by making below updates:

Update you local host file with the domain. Something like this - 

127.0.0.1 www.mydomain.com

Add the virtual host config in your dispatcher conf file for www.mydomain.com similar to sample localhost configuration.

Level 2
March 30, 2022

My dispatcher runs on port 8080. I'm assuming I do something like

127.0.0.1:8080 www.mydomain.com

Would my vhost file need to be like be like the following?

<VirtualHost www.mydomain.com:8080>
...
</VirtualHost>

 

Anish-Sinha
Adobe Employee
Adobe Employee
March 30, 2022

You cannot put the port number in host file. It will only map to your default port 80. You can try running apache server on port 80 or else as an alternate solution follow these:

  1. Install Fiddler2

  2. Navigate to Fiddler2 menu:- Tools > HOSTS.. (Click to select)

  3. Add a line like this:-

    localhost:8080 www.mydomain.com

  4. Save the file & then checkout www.mydomainname.com in browser.

Vhost config in apache looks good. Or for your locl you can just put below one. It will handle all domains on port 8080

<VirtualHost *:8080>
...
</VirtualHost>