-
Notifications
You must be signed in to change notification settings - Fork 47
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
Running OpenResty on Fly #278
Comments
I'm a huge fan of OpenResty examples, I tend to conflate openresty + nginx (just because openresty is the best way to do lua in nginx). I think it makes total sense to hook up openresty, even if we just call it an nginx example. One interesting use case for this would be per region rate limiting with Redis: https://github.com/TiVo/lua-resty-rate-limit |
Oh, auth is another good thing to show with OpenResty: https://github.com/zmartzone/lua-resty-openidc |
Here's the outline for what I'm thinking as a good first article:
I think the auth example is good, but worth a separate article because I'd need to explain some of the other prerequisites in more detail. If that sounds good, I could create a new issue to write a follow-up article on using OpenResty to do auth? |
Yeah I like it. Auth makes total sense standalone. |
I've got the basic app going, but can't get the Nginx logs to show up in Fly. OpenResty is supposed to be symlinking Nginx access and error logs to stdout and stderr (and this works locally with Docker), but I can't get it working on Fly. Is there an example of this somewhere? Any ideas? |
Nevermind, figured this out. |
Oh I'm interested in what you found, we've had a few people with issues in different frameworks writing to |
Nope, that wasn't the issue. I think my problem was that my updates to the Nginx Conf file weren't taking place because when I did a |
One more weird one: Redis on Fly isn't working for me. Every time I authenticate in Lua, it returns the error, When I connect from my local terminal using Any ideas about that? |
Can you hit https://debug.fly.dev and paste the output here? I want to see which region you're connecting to. |
|
I played around with this more this morning - tried destroying my app and redeploying - and my Redis is still not working. Just immediately closes the connection whether I use Is there anything else I can do to debug this or try to narrow down the issue? Can I force my app to use a different region or something? I could also send you my connection string so you could try it @mrkurt. Let me know what you think. |
@karllhughes could you share the connection string you're using with [email protected]? When you say |
I'm starting to understand my issue a little more clearly, and it appears to actually be that Lua can't resolve the DNS record. Probably this: openresty/lua-resty-redis#159 I'm going to set a resolver, which should fix it. I'll let you know if I continue to have issues though, thanks! |
@mrkurt @kittybot I just finished editing this article and transferred it to the Fly-Examples org: https://github.com/fly-examples/fly-openresty I started down the path of caching the API's response with Redis, but that ended up making the example very complicated because I couldn't use Nginx's default reverse proxy. So, I opted to use a simpler example of connecting to Redis to check some cached API keys for simple authentication. I think there are a ton of good deep-dives we could do with OpenResty, but I tried to keep this tutorial approachable while still showcasing some of the power of OpenResty on Fly. Let me know if you have any feedback! |
fyi for those who want to set up an example at a k8s provider openresty/lua-resty-redis#159 (comment) |
Initially, we talked about running OpenResty to serve and cache static files, but it seems like you can do that with vanilla NGinx, so unless I misunderstood, that doesn't seem like that exciting of an example.
What about running OpenResty to serve a Redis backend on Fly? Seems like a unique and interesting case and it uses the lua-resty-redis driver, so it's more unique to OpenResty.
I'm familiar with NGinx, but not as experienced with OpenResty and Lua, so I welcome any direction/feedback on this one. It seems like there are a lot of directions you could go with this based on the OpenResty docs.
The text was updated successfully, but these errors were encountered: