Answers: <p>According to your screen dump you have your port 80 mapped to the Traefik container</p>
  <p><code>58cd5b59579c        traefik:v2.2                  &quot;/entrypoint.sh --lo…&quot;   16 minutes ago      Up 15 minutes       0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp   frappe_docker_traefik_1</code></p>
  <p>The listen address of this mapping is <code>0.0.0.0</code> on both port <code>80 HTTP</code>, and <code>443 HTTPS</code> which means it listens on all your computer interfaces. Including the local-loopback interface which has the address of <code>127.0.0.1</code>.</p>
  <p>Most operating systems have a file called <code>hosts</code> which is located at <code>/etc/hosts</code> for Linux, MacOS, BSD and at <code>C:\Windows\System32\drivers\etc\hosts</code> for Windows 10.</p>
  <p>This file maps the DNS names (such as <code>localhost</code>) to their IP addresses, like <code>127.0.0.1</code>.</p>
  <p>For you to have a working <code>FQDN</code>, you can temporarily create a new mapping in this file to map your desired name to the local-loopback address of 127.0.0.1.</p>
  <p>Edit the <code>hosts</code> file and add a line saying:</p>
  <pre><code>127.0.0.1 erp.mordor.bounceme.net
  </code></pre>
  <p>The applications that lookup that name later, such as <code>lynx</code>, will now know that <code>erp.mordor.bounceme.net</code> is located at <code>127.0.0.1</code> IP address. And your Docker Traefik container is listening there (as well) on ports <code>80</code> and <code>443</code>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-11-14T07:23:33.170Z
Answers: yes, I've configured this.  It seems to be a `traefik` configuration problem:  https://devops.stackexchange.com/q/12762/23443
Answers: Nicholas Saunders
Answers: CC BY-SA 4.0
Answers: 2020-11-14T07:07:11.473Z
Answers: 2020-11-14T07:07:11.473Z
Answers: Evgeny Zislis
Body: <p>About nine minutes into a <a href="https://youtu.be/_08L9pubPCY" rel="nofollow noreferrer">tutorial</a> on <code>ERPNext</code> I followed directions as:</p>
  <pre><code>root@mordor:/home/nicholas/git/frappe_docker# 
  root@mordor:/home/nicholas/git/frappe_docker# cat .env
  LETSENCRYPT_EMAIL=nicholas@mordor.bounceme.net
  ERPNEXT_VERSION=edge
  FRAPPE_VERSION=edge
  MARIADB_HOST=mariadb
  MYSQL_ROOT_PASSWORD=admin
  SITE_NAME=erp.mordor.bounceme.net
  SITES=`erp.mordor.bounceme.net`
  DB_ROOT_USER=root
  ADMIN_PASSWORD=admin
  INSTALL_APPS=erpnext
  ENTRYPOINT_LABEL=traefik.http.routers.erpnext-nginx.entrypoints=websecure
  CERT_RESOLVER_LABEL=traefik.http.routers.erpnext-nginx.tls.certresolver=myresolver
  HTTPS_REDIRECT_RULE_LABEL=traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)
  HTTPS_REDIRECT_ENTRYPOINT_LABEL=traefik.http.routers.http-catchall.entrypoints=web
  HTTPS_REDIRECT_MIDDLEWARE_LABEL=traefik.http.routers.http-catchall.middlewares=redirect-to-https
  HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL=traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
  root@mordor:/home/nicholas/git/frappe_docker# 
  root@mordor:/home/nicholas/git/frappe_docker# docker-compose up -d
  Creating network &quot;frappe_docker_default&quot; with the default driver
  Creating volume &quot;frappe_docker_redis-cache-vol&quot; with default driver
  Creating volume &quot;frappe_docker_cert-vol&quot; with default driver
  Creating volume &quot;frappe_docker_redis-queue-vol&quot; with default driver
  Creating volume &quot;frappe_docker_mariadb-vol&quot; with default driver
  Creating volume &quot;frappe_docker_redis-socketio-vol&quot; with default driver
  Creating volume &quot;frappe_docker_sites-vol&quot; with default driver
  Creating volume &quot;frappe_docker_assets-vol&quot; with default driver
  Pulling erpnext-python (frappe/erpnext-worker:edge)...
  edge: Pulling from frappe/erpnext-worker
  Digest: sha256:45e7fb925187bc6ed71ca8db2bd886a8cbcfb7714197b7f140fb479469bc3c98
  Status: Downloaded newer image for frappe/erpnext-worker:edge
  Pulling mariadb (mariadb:10.3)...
  10.3: Pulling from library/mariadb
  6a5697faee43: Pull complete
  ba13d3bc422b: Pull complete
  a254829d9e55: Pull complete
  2ee2cadd29fc: Pull complete
  6915a184049d: Pull complete
  5ca6ffdb5f56: Pull complete
  1537f7bbef8b: Pull complete
  5790e54322d1: Pull complete
  ea98cb829471: Pull complete
  3247072bad5f: Pull complete
  b3f16e2db43f: Pull complete
  d78c54af82d5: Pull complete
  b08843faa954: Pull complete
  Digest: sha256:69dec37e0651252108d61ac87874ed8d83b74ead38d196b0bb10d784b7295e8b
  Status: Downloaded newer image for mariadb:10.3
  Pulling frappe-socketio (frappe/frappe-socketio:edge)...
  edge: Pulling from frappe/frappe-socketio
  babf97a3f00a: Pull complete
  d81eb1809d95: Pull complete
  d50e90677ab1: Pull complete
  4ca478941ba5: Pull complete
  cac0c8c03bb1: Pull complete
  55aedfc1b65f: Pull complete
  1bee561a211c: Pull complete
  fab9a623660f: Pull complete
  7b5f157fcbc6: Pull complete
  e5f74c3ab32d: Pull complete
  6f1760dc7d35: Pull complete
  f9389a9f5f4c: Pull complete
  Digest: sha256:dfe6dc1d2ffb824f04dc2cd620327f75355620ba657865ee98441c88b8596ed5
  Status: Downloaded newer image for frappe/frappe-socketio:edge
  Pulling traefik (traefik:v2.2)...
  v2.2: Pulling from library/traefik
  cbdbe7a5bc2a: Pull complete
  f16506d32a25: Pull complete
  605303653d66: Pull complete
  a9005a35b171: Pull complete
  Digest: sha256:ea0aa8832bfd08369166baecd40b35fc58979df8f5dc5182e4e63ee6adbe66db
  Status: Downloaded newer image for traefik:v2.2
  Pulling erpnext-nginx (frappe/erpnext-nginx:edge)...
  edge: Pulling from frappe/erpnext-nginx
  bb79b6b2107f: Pull complete
  5a9f1c0027a7: Pull complete
  b5c20b2b484f: Pull complete
  166a2418f7e8: Pull complete
  1966ea362d23: Pull complete
  3915f6e86363: Pull complete
  f6bb7178bcfb: Pull complete
  44ac8c313cd6: Pull complete
  07bf0268acb1: Pull complete
  2b15c776928e: Pull complete
  58517104a340: Pull complete
  44e719acaf68: Pull complete
  f16420799ad5: Pull complete
  Digest: sha256:d7031e28b62d0e67eae432937902fe618d32709039a1d63199598881ed5c6459
  Status: Downloaded newer image for frappe/erpnext-nginx:edge
  Creating frappe_docker_redis-cache_1     ... done
  Creating frappe_docker_erpnext-nginx_1  ... done
  Creating frappe_docker_mariadb_1        ... done
  Creating frappe_docker_erpnext-python_1  ... done
  Creating frappe_docker_redis-socketio_1 ... done
  Creating frappe_docker_traefik_1                ... done
  Creating frappe_docker_redis-queue_1    ... done
  Creating frappe_docker_frappe-socketio_1        ... done
  Creating frappe_docker_site-creator_1           ... done
  Creating frappe_docker_erpnext-schedule_1       ... done
  Creating frappe_docker_erpnext-worker-long_1    ... done
  Creating frappe_docker_erpnext-worker-default_1 ... done
  Creating frappe_docker_erpnext-worker-short_1   ... done
  root@mordor:/home/nicholas/git/frappe_docker# 
  
  
  
  
  root@mordor:~# 
  root@mordor:~# docker container list
  CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS                                      NAMES
  d150de825277        frappe/erpnext-worker:edge    &quot;docker-entrypoint.s…&quot;   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-worker-short_1
  54c716c27275        frappe/erpnext-worker:edge    &quot;docker-entrypoint.s…&quot;   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-worker-default_1
  ef73c8514f32        frappe/erpnext-worker:edge    &quot;docker-entrypoint.s…&quot;   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-schedule_1
  ce45f0955bac        frappe/erpnext-worker:edge    &quot;docker-entrypoint.s…&quot;   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-worker-long_1
  9a3eb0a2f9d2        frappe/erpnext-worker:edge    &quot;docker-entrypoint.s…&quot;   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_site-creator_1
  652280f21336        frappe/frappe-socketio:edge   &quot;docker-entrypoint.s…&quot;   16 minutes ago      Up 15 minutes                                                  frappe_docker_frappe-socketio_1
  e6b6c59b01fd        redis:latest                  &quot;docker-entrypoint.s…&quot;   16 minutes ago      Up 16 minutes       6379/tcp                                   frappe_docker_redis-queue_1
  c3e0d8c41c08        redis:latest                  &quot;docker-entrypoint.s…&quot;   16 minutes ago      Up 16 minutes       6379/tcp                                   frappe_docker_redis-socketio_1
  58cd5b59579c        traefik:v2.2                  &quot;/entrypoint.sh --lo…&quot;   16 minutes ago      Up 15 minutes       0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp   frappe_docker_traefik_1
  4a4b4caffbec        frappe/erpnext-worker:edge    &quot;docker-entrypoint.s…&quot;   16 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-python_1
  221dd3e1e419        frappe/erpnext-nginx:edge     &quot;/docker-entrypoint.…&quot;   16 minutes ago      Up 14 minutes       80/tcp                                     frappe_docker_erpnext-nginx_1
  6100cc729cb1        redis:latest                  &quot;docker-entrypoint.s…&quot;   16 minutes ago      Up 15 minutes       6379/tcp                                   frappe_docker_redis-cache_1
  a31d8a43726c        mariadb:10.3                  &quot;docker-entrypoint.s…&quot;   16 minutes ago      Up 16 minutes       3306/tcp                                   frappe_docker_mariadb_1
  root@mordor:~# 
  </code></pre>
  <p>However:</p>
  <pre><code>nicholas@mordor:~$ 
  nicholas@mordor:~$ lynx localhost --dump
  
  Looking up localhost
  Making HTTP connection to localhost
  Sending HTTP request.
  HTTP request sent; waiting for response.
  HTTP/1.0 302 Found
  Data transfer complete
  HTTP/1.0 302 Found
  Using https://localhost/
  Looking up localhost
  Making HTTPS connection to localhost
  
  lynx: Can't access startfile http://localhost/
  nicholas@mordor:~$ 
  </code></pre>
  <p>How do I configure as above for local usage?  Effectively, offline.  To my understanding, <code>nginx</code> is being used as a reverse proxy here.</p>
  <p>I'm getting some result:</p>
  <pre><code>nicholas@mordor:~$ 
  nicholas@mordor:~$ lynx erp.mordor.bounceme.net --dump
  
  nicholas@mordor:~$ 
  </code></pre>
  <p>but not the welcome screen I'm looking for.  The <code>FQDN</code> isn't publicly available.</p>
  
Tags: <docker><docker-compose><nginx><dns><environment-variables>
Title: How to access a fully qualified domain name through "localhost"?
UserDisplayName: Nicholas Saunders
ThreadText: # How to access a fully qualified domain name through "localhost"?
  
  (Asked by: username_0 on 2020-11-13)
  
  About nine minutes into a [tutorial](https://youtu.be/_08L9pubPCY) on `ERPNext` I followed directions as:
  
  ```
  root@mordor:/home/username_0/git/frappe_docker# 
  root@mordor:/home/username_0/git/frappe_docker# cat .env
  LETSENCRYPT_EMAIL=username_0@mordor.bounceme.net
  ERPNEXT_VERSION=edge
  FRAPPE_VERSION=edge
  MARIADB_HOST=mariadb
  MYSQL_ROOT_PASSWORD=admin
  SITE_NAME=erp.mordor.bounceme.net
  SITES=`erp.mordor.bounceme.net`
  DB_ROOT_USER=root
  ADMIN_PASSWORD=admin
  INSTALL_APPS=erpnext
  ENTRYPOINT_LABEL=traefik.http.routers.erpnext-nginx.entrypoints=websecure
  CERT_RESOLVER_LABEL=traefik.http.routers.erpnext-nginx.tls.certresolver=myresolver
  HTTPS_REDIRECT_RULE_LABEL=traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)
  HTTPS_REDIRECT_ENTRYPOINT_LABEL=traefik.http.routers.http-catchall.entrypoints=web
  HTTPS_REDIRECT_MIDDLEWARE_LABEL=traefik.http.routers.http-catchall.middlewares=redirect-to-https
  HTTPS_USE_REDIRECT_MIDDLEWARE_LABEL=traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
  root@mordor:/home/username_0/git/frappe_docker# 
  root@mordor:/home/username_0/git/frappe_docker# docker-compose up -d
  Creating network "frappe_docker_default" with the default driver
  Creating volume "frappe_docker_redis-cache-vol" with default driver
  Creating volume "frappe_docker_cert-vol" with default driver
  Creating volume "frappe_docker_redis-queue-vol" with default driver
  Creating volume "frappe_docker_mariadb-vol" with default driver
  Creating volume "frappe_docker_redis-socketio-vol" with default driver
  Creating volume "frappe_docker_sites-vol" with default driver
  Creating volume "frappe_docker_assets-vol" with default driver
  Pulling erpnext-python (frappe/erpnext-worker:edge)...
  edge: Pulling from frappe/erpnext-worker
  Digest: sha256:45e7fb925187bc6ed71ca8db2bd886a8cbcfb7714197b7f140fb479469bc3c98
  Status: Downloaded newer image for frappe/erpnext-worker:edge
  Pulling mariadb (mariadb:10.3)...
  10.3: Pulling from library/mariadb
  6a5697faee43: Pull complete
  ba13d3bc422b: Pull complete
  a254829d9e55: Pull complete
  2ee2cadd29fc: Pull complete
  6915a184049d: Pull complete
  5ca6ffdb5f56: Pull complete
  1537f7bbef8b: Pull complete
  5790e54322d1: Pull complete
  ea98cb829471: Pull complete
  3247072bad5f: Pull complete
  b3f16e2db43f: Pull complete
  d78c54af82d5: Pull complete
  b08843faa954: Pull complete
  Digest: sha256:69dec37e0651252108d61ac87874ed8d83b74ead38d196b0bb10d784b7295e8b
  Status: Downloaded newer image for mariadb:10.3
  Pulling frappe-socketio (frappe/frappe-socketio:edge)...
  edge: Pulling from frappe/frappe-socketio
  babf97a3f00a: Pull complete
  d81eb1809d95: Pull complete
  d50e90677ab1: Pull complete
  4ca478941ba5: Pull complete
  cac0c8c03bb1: Pull complete
  55aedfc1b65f: Pull complete
  1bee561a211c: Pull complete
  fab9a623660f: Pull complete
  7b5f157fcbc6: Pull complete
  e5f74c3ab32d: Pull complete
  6f1760dc7d35: Pull complete
  f9389a9f5f4c: Pull complete
  Digest: sha256:dfe6dc1d2ffb824f04dc2cd620327f75355620ba657865ee98441c88b8596ed5
  Status: Downloaded newer image for frappe/frappe-socketio:edge
  Pulling traefik (traefik:v2.2)...
  v2.2: Pulling from library/traefik
  cbdbe7a5bc2a: Pull complete
  f16506d32a25: Pull complete
  605303653d66: Pull complete
  a9005a35b171: Pull complete
  Digest: sha256:ea0aa8832bfd08369166baecd40b35fc58979df8f5dc5182e4e63ee6adbe66db
  Status: Downloaded newer image for traefik:v2.2
  Pulling erpnext-nginx (frappe/erpnext-nginx:edge)...
  edge: Pulling from frappe/erpnext-nginx
  bb79b6b2107f: Pull complete
  5a9f1c0027a7: Pull complete
  b5c20b2b484f: Pull complete
  166a2418f7e8: Pull complete
  1966ea362d23: Pull complete
  3915f6e86363: Pull complete
  f6bb7178bcfb: Pull complete
  44ac8c313cd6: Pull complete
  07bf0268acb1: Pull complete
  2b15c776928e: Pull complete
  58517104a340: Pull complete
  44e719acaf68: Pull complete
  f16420799ad5: Pull complete
  Digest: sha256:d7031e28b62d0e67eae432937902fe618d32709039a1d63199598881ed5c6459
  Status: Downloaded newer image for frappe/erpnext-nginx:edge
  Creating frappe_docker_redis-cache_1     ... done
  Creating frappe_docker_erpnext-nginx_1  ... done
  Creating frappe_docker_mariadb_1        ... done
  Creating frappe_docker_erpnext-python_1  ... done
  Creating frappe_docker_redis-socketio_1 ... done
  Creating frappe_docker_traefik_1                ... done
  Creating frappe_docker_redis-queue_1    ... done
  Creating frappe_docker_frappe-socketio_1        ... done
  Creating frappe_docker_site-creator_1           ... done
  Creating frappe_docker_erpnext-schedule_1       ... done
  Creating frappe_docker_erpnext-worker-long_1    ... done
  Creating frappe_docker_erpnext-worker-default_1 ... done
  Creating frappe_docker_erpnext-worker-short_1   ... done
  root@mordor:/home/username_0/git/frappe_docker# 
  
  root@mordor:~# 
  root@mordor:~# docker container list
  CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS                                      NAMES
  d150de825277        frappe/erpnext-worker:edge    "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-worker-short_1
  54c716c27275        frappe/erpnext-worker:edge    "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-worker-default_1
  ef73c8514f32        frappe/erpnext-worker:edge    "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-schedule_1
  ce45f0955bac        frappe/erpnext-worker:edge    "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-worker-long_1
  9a3eb0a2f9d2        frappe/erpnext-worker:edge    "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_site-creator_1
  652280f21336        frappe/frappe-socketio:edge   "docker-entrypoint.s…"   16 minutes ago      Up 15 minutes                                                  frappe_docker_frappe-socketio_1
  e6b6c59b01fd        redis:latest                  "docker-entrypoint.s…"   16 minutes ago      Up 16 minutes       6379/tcp                                   frappe_docker_redis-queue_1
  c3e0d8c41c08        redis:latest                  "docker-entrypoint.s…"   16 minutes ago      Up 16 minutes       6379/tcp                                   frappe_docker_redis-socketio_1
  58cd5b59579c        traefik:v2.2                  "/entrypoint.sh --lo…"   16 minutes ago      Up 15 minutes       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   frappe_docker_traefik_1
  4a4b4caffbec        frappe/erpnext-worker:edge    "docker-entrypoint.s…"   16 minutes ago      Up 15 minutes       8000/tcp                                   frappe_docker_erpnext-python_1
  221dd3e1e419        frappe/erpnext-nginx:edge     "/docker-entrypoint.…"   16 minutes ago      Up 14 minutes       80/tcp                                     frappe_docker_erpnext-nginx_1
  6100cc729cb1        redis:latest                  "docker-entrypoint.s…"   16 minutes ago      Up 15 minutes       6379/tcp                                   frappe_docker_redis-cache_1
  a31d8a43726c        mariadb:10.3                  "docker-entrypoint.s…"   16 minutes ago      Up 16 minutes       3306/tcp                                   frappe_docker_mariadb_1
  root@mordor:~# 
  
  ```
  
  However:
  
  ```
  username_0@mordor:~$ 
  username_0@mordor:~$ lynx localhost --dump
  
  Looking up localhost
  Making HTTP connection to localhost
  Sending HTTP request.
  HTTP request sent; waiting for response.
  HTTP/1.0 302 Found
  Data transfer complete
  HTTP/1.0 302 Found
  Using https://localhost/
  Looking up localhost
  Making HTTPS connection to localhost
  
  lynx: Can't access startfile http://localhost/
  username_0@mordor:~$ 
  
  ```
  
  How do I configure as above for local usage? Effectively, offline. To my understanding, `nginx` is being used as a reverse proxy here.
  
  I'm getting some result:
  
  ```
  username_0@mordor:~$ 
  username_0@mordor:~$ lynx erp.mordor.bounceme.net --dump
  
  username_0@mordor:~$ 
  
  ```
  
  but not the welcome screen I'm looking for. The `FQDN` isn't publicly available.
  
  **Tags:** docker, docker-compose, nginx, dns, environment-variables
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-14. Score: 2
  
  According to your screen dump you have your port 80 mapped to the Traefik container
  
  `58cd5b59579c traefik:v2.2 "/entrypoint.sh --lo…" 16 minutes ago Up 15 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp frappe_docker_traefik_1`
  
  The listen address of this mapping is `0.0.0.0` on both port `80 HTTP`, and `443 HTTPS` which means it listens on all your computer interfaces. Including the local-loopback interface which has the address of `127.0.0.1`.
  
  Most operating systems have a file called `hosts` which is located at `/etc/hosts` for Linux, MacOS, BSD and at `C:\Windows\System32\drivers\etc\hosts` for Windows 10.
  
  This file maps the DNS names (such as `localhost`) to their IP addresses, like `127.0.0.1`.
  
  For you to have a working `FQDN`, you can temporarily create a new mapping in this file to map your desired name to the local-loopback address of 127.0.0.1.
  
  Edit the `hosts` file and add a line saying:
  
  ```
  127.0.0.1 erp.mordor.bounceme.net
  
  ```
  
  The applications that lookup that name later, such as `lynx`, will now know that `erp.mordor.bounceme.net` is located at `127.0.0.1` IP address. And your Docker Traefik container is listening there (as well) on ports `80` and `443`.
  
  > **Comments:**
  > **username_0**: yes, I've configured this.  It seems to be a `traefik` configuration problem:  https://devops.stackexchange.com/q/12762/23443  
  
  ---
  
  