Arc Forumnew | comments | leaders | submitlogin
Any Ideas Why I am Getting 502 Proxy Errors?
6 points by jwk 1386 days ago | 14 comments
First, akkartik, thanks for your info on creating an about page. I still have not got around to doing it but will do so soon.

To set up AfriTech.org I followed these instructions:

http://nicholasblee.com/blog/hacker-news-clone-on-a-free-aws-ec2-instance-wapache-reverse-proxy-server-20-min-install/#

Lately users have been getting lots of 502 errors and I am wondering if folks on this forum would have any insight?

Every time this happens I restart the news server and then it works fine for a day or so. When the problem happens the front end apache server is usually fine, because users can still get to http://AfriTech.org/blog (wordpress).

I am wondering if setting up the news server on its own subdomain (news.AfriTech.org) and getting rid of the proxy configuration would help?



4 points by vuong 1386 days ago | link

I use nginx as the reverse proxy for http://www.geek.vn/

It runs smoothly unless the are too many connections (seldom). The reason is that I use a very low-end VPS (RAM 128 MB) :-).

I think you can create a "news" subdomain within your domain control panel (I use Cloudflare instead), then point to the IP of the server. Just my thought only.

I hope it works with you.

-----

2 points by akkartik 1385 days ago | link

That's running on just 128MB? That's awesome.

-----

2 points by akkartik 1386 days ago | link

I think you might be affected by gotcha #3 at https://sites.google.com/site/arclanguagewiki/arc-3_1/known-... because you're using arc behind apache. Try one of the workarounds and report back?

-----

2 points by jwk 1385 days ago | link

I just implemented the abusive ip fix. Hopefully this should fix it. Now that I recall, I did this the very first time I set up the server and it ran fine for a loooooooong time. So long that I forgot to take that step again!

-----

2 points by vuong 1385 days ago | link

I just check http://afritech.org/whoami and it returns as vuong at 127.0.0.1

Do the same at arclanguage.org/whoami you will see the difference. I think we need some further dig :-)

-----

1 point by akkartik 1385 days ago | link

Ah, you're right. I never remember /whoami.

-----

1 point by vuong 1385 days ago | link

I use your code on www.geek.vn than switch to hackerstreet.in code. It is mostly similar but /whoami only. Your ARC code tunrs to 127 :-), not real IP.

Hackerstreet code helps me solve that tiny issue and also adds an "ask" tab on the top bar. I wonder how to add another one such as "blog" (so click on with access geek.vn/blog or about/contact etc...:-( Any help @akkartik. I am just an actual non-geek/coder :-)

-----

1 point by akkartik 1385 days ago | link

"Your ARC code tunrs to 127 :-), not real IP."

That's weird. I just doublechecked, and the fix as in anarki seems to be working.

Are you running behind nginx? I think it requires some tweaks to pass through X-Forwarded-For..

-----

1 point by akkartik 1385 days ago | link

"I wonder how to add another tab such as blog"

I think you want the earlier thread jwk was referring to: http://www.arclanguage.org/item?id=17139.

-----

1 point by vuong 1384 days ago | link

I just want to add a link on the top bar, like a "news" tab, then the visitor click on that it will turn to http://blog.geek.vn subdomain. Anyways, the previous threat submitted by jwk is so helpful to me.

-----

1 point by jwk 1385 days ago | link

So what should I do?

-----

1 point by akkartik 1385 days ago | link

I just tried it behind apache, and the fix is still in working condition. Can you check if you made an error in adding it?

Is your codebase someplace public? Feel free to email it to me (address in profile). Or paste in that section of your srv.arc into a comment here to get some more eyes on it.

Did you copy the fix from https://github.com/nex3/arc/commit/1f69b0edb9? Try using the current head: http://github.com/nex3/arc/blob/7f3a5a2979/lib/srv.arc

-----

1 point by vuong 1385 days ago | link

You can backup your database (Arc folder within your VPS), then upload this code https://github.com/rick2047/arc

You can do some optimization and customization on the code such as removing some Hackerstreet related stuffs.

I also run another test site at Amazon EC2 free tier VPS:

http://vietstudying.com

-----

2 points by jwk 1384 days ago | link

Thank you all folks. Will likely do this next weekend and report back!

-----