Skip to main content

Registering API FQDN to LAN

The below step will guide you on how to register your application to the nginx.

Register to your respective hosts file.

  1. For our current setup, we are using the hosts.atlas for APIs deployed via Docker.
  2. Access the directory via etc/hosts/
  3. edit the text file using sudo nano hosts.atlas.
  4. underneath, add an entry with the ff. format:
192.168.100.60 fqdn.home.arpa
info

Our DnsMasq/NGINX is deployed in 192.168.100.60.

info

For applications in LAN, it is recommended to use home.arpa.

  1. Save the text file using Ctrl+O.
  2. Restart the DNSMasq using
systemctl restart dnsmasq.service
  1. If you input your FQDN to your browser, you will see the NGINX homepage. We should proceed to the next step...

Configure reverse-proxy to your applications

  1. Traverse to /etc/nginx/sites-enabled
  2. You will see that there is a atlas-dev setup there, but feel free to create your own file:
  3. edit the file using sudo nano atlas-dev
  4. add another entry:
server {
listen 80;
server_name [YOUR_FQDN];

location / {
proxy_pass http://[DEPLOYMENT_LOCATION_HOST]:[YOUR_PORT];
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
}
  1. Restart the nginx using:
systemctl restart nginx.service
  1. Test your changes.