-
Notifications
You must be signed in to change notification settings - Fork 20
PagePark routing requests between apps on the same server #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please disregard if this is off base, not considering all the details you've shared or is something so basic that you've already ruled it out... The host machine may need to have ports 1339 and 1340 open (on my Ubuntu dev server, for example, for Node.js development, when I'm ready to test from another machine on my network, I have to use UFW to specifically OPEN the custom ports I'm using. And I think I saw a reference to port 80 in the code as well, so nothing else can be running on that port also. That would be my starting point at least. Next I would look to see if I can identify any networking related issues that may come into play -- same ip range? same VLAN? Good luck! |
I think this is related to scripting/Scripting-News#110 where the PREROUTING to map 80 to the pagepark listener is never even seen by connections that originate from the same host. That is, processes on that server try to connect to port 80, and get blocked because nothing is listening there. You can diagnose this by opening a terminal and using Update: https://grainier.net/iptables-nat-prerouting-not-work-localhost/ has a reasonably concise explanation of the PREROUTING issue with localhost:
(You'd need to replace "9191" with the actual listener port in both entries.) |
I was about to point to a ServerFault entry about OUTPUT rules for localhost, but @mcenirm beat me by 30 seconds. 😄 Here it is anyway: https://serverfault.com/questions/211536/iptables-port-redirect-not-working-for-localhost |
Thanks to all esp @mcenirm. That was the problem. Whew. Glad I asked. I posted this note in my development diary. |
Updated the docs. https://github.com/scripting/pagePark#mapping-port-80-to-1339 |
The problem
Longstanding problem with PagePark, my homebrew web server.
Suppose two apps are running on the same machine where PP is the http server.
Say one app is on the domain hello.com and the other is goodbye.com.
Suppose the first makes a request of the second.
http://goodbye.com/index.html
It will get a connection refused.
Make the request from another server and it works fine.
Where to look
This is where PP maps requests to domains it's serving.
BTW, it uses request, yes I know it has been deprecated.
The pipe stuff in delegateRequest is like a black box to me, I don't really understand the magic it's doing or if it's really necessary. It probably isn't, but I wrote this code a long time ago, when I wasn't as skilled in Node.
Any help much appreciated. :-)
The text was updated successfully, but these errors were encountered: