Skip to content
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

Load balancing with "content_by_lua block" #35

Open
Fatahir opened this issue Sep 13, 2020 · 0 comments
Open

Load balancing with "content_by_lua block" #35

Fatahir opened this issue Sep 13, 2020 · 0 comments

Comments

@Fatahir
Copy link

Fatahir commented Sep 13, 2020

I have a content_by_lua block which execute when below location run.

location / {
      content_by_lua '
          local client = require "readuser"
          client.ReadUser();
      ';
    }

I want to do load balancing between multiple servers so that all servers run same lua block. I thought i did this by

http
{
 upstream read
 {
  server one;
  server two;
  server three;
 }
}

server {
 location / {
  proxy_pass http://read
  content_by_lua '
          local client = require "readuser"
          client.ReadUser();
      ';
 }
}

but it did not work. How can I achieved this with lua block?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant