Public URLs
Web services and static sites answer at one public URL under each domain of the server.
The URL starts with the name of the service: shop.
Web services and static sites are public. Each one answers at <name>.<domain> under each domain of the server, and at the custom domains that you add.
A server starts with one domain: its base domain. It comes from ferryd --base-domain, and the default is localhost. Browsers send each *.localhost name to 127.0.0.1, thus you need no DNS setup on your machine.
Who has a public URL
| Service type | Public URL | Address for the other services |
|---|---|---|
| Web service | <name>.<domain> for each domain of the server, and custom domains | <name>:<port> |
| Static site | <name>.<domain> for each domain of the server, and custom domains | <name>:80 |
| Private service | none | <name>:<port> |
| Background worker | none | No port. It can open connections. |
| Cron job | none | No port. Each run joins the network. |
Your app must listen on 0.0.0.0 and $PORT
Ferry publishes the port of each container on 127.0.0.1 of the server and sends the requests there. In the container, your app must listen on all interfaces (0.0.0.0), not on 127.0.0.1. Ferry gives the port in PORT.
- The port is the port of the proxy:
--proxy-addr, default8080. - If clients reach the proxy on a different port, set
--public-port. An example is a router that sends a different port to the proxy. - Ferry leaves the port out when it is
80. - When automatic HTTPS is on, public URLs use
https://with no port. A local name never gets a certificate and stays onhttp://.
If the base domain is local (localhost, *.localhost, *.local, *.internal, *.test), Ferry also routes ferry.<base-domain> to the dashboard and the API.
On a public base domain, this route is off unless you set --dashboard-host. Read Production setup before you set it.