Lock server to localhost

I'm not sure if this is the right place for this question, so if it needs to be moved please accept my apologies.

I'd like to use my freebsd set up to test a few content management systems. However, I'm not sure which is the best way to guard them from the open internet. Ideally I would like any sites only to be available on localhost and not accessible from any other machine (even the local network). Is there a way using freebsd to do this, or how would I be best doing it with the server. I can use either nginx or apache.
 
However, I'm not sure which is the best way to guard them from the open internet.
If these systems are on a local network they won't be accessible from the internet. Unless you specifically added a NAT redirection (port forwarding) on your internet router. Or through some network admin configuration if you're on a company network. Nothing on the local LAN should be directly accessible from the Internet if things have been set up properly.

Ideally I would like any sites only to be available on localhost and not accessible from any other machine (even the local network).
Bind the webserver frontend and/or the web application itself to 127.0.0.1 or localhost (which would include 127.0.0.1 and ::1). This also means it cannot be accessed 'remotely', even from other machines on the same LAN. So you'd have to run your tests on the same machine the application is running on, or make clever use of SSH port forwarding.

Is there a way using freebsd to do this
The OS is irrelevant, this is just network configuration and configuration of the application services.
 
Back
Top