I have a simple web app which displays a simple hello world. I can access the app through the web browser (127.0.0.1:3000/test/hello), but cannot access it using the local ip the app is running on, or using my external ip (i have forwarded the port appropriately on my router).
server.modules += ( "mod_fastcgi" )
server.document-root = "/Users/me/test"
server.port = 3000
server.bind = "127.0.0.1"
fastcgi.debug = 1
fastcgi.server = (
"test" =>
(
"python-fcgi" =>
(
"socket" => "/tmp/fastcgi.python.socket",
"bin-path" => "/Users/me/hello.py",
"check-local" => "disable",
"max-procs" => 1,
)
))
How do I access the web app using my external ip?
Set
server.bindto the local network IP of the server rather than localhost127.0.0.1. Also check that port 3000 is not blocked between hosts on your network.By binding to localhost you are bound to the loopback interface of your machine, which means that lighttpd is not even listening on the network at all.
Alternatively, to accept request no matter how they are directed to the server, bind to
0.0.0.0which enables all interfaces.