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.
- For our current setup, we are using the
hosts.atlasfor APIs deployed via Docker. - Access the directory via
etc/hosts/ - edit the text file using
sudo nano hosts.atlas. - 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.
- Save the text file using
Ctrl+O. - Restart the DNSMasq using
systemctl restart dnsmasq.service
- 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
- Traverse to
/etc/nginx/sites-enabled - You will see that there is a
atlas-devsetup there, but feel free to create your own file: - edit the file using
sudo nano atlas-dev - 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;
}
}
- Restart the nginx using:
systemctl restart nginx.service
- Test your changes.