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

Add a server path option to proxy the asynqmon #156

Open
lufishggg opened this issue Sep 17, 2021 · 8 comments
Open

Add a server path option to proxy the asynqmon #156

lufishggg opened this issue Sep 17, 2021 · 8 comments

Comments

@lufishggg
Copy link

For example there is an application running at port 3000, asynqmon running at port 3001. We want the path /asynqmon to proxy to port 3001, which now is impossible because of the path prefix unmatch.

@hibiken
Copy link
Owner

hibiken commented Sep 21, 2021

@lufishggg thank you for opening this issue!

What are you using for reverse proxy? Also, would you mind giving more details on what's making things impossible?

@lufishggg
Copy link
Author

For example, I have an application which is used as a management platform, we call it A. There is a host like test.xxx.com. The nginx will proxy all requests whose path prefix is /admin to A. For example, test.xxx.com/admin/users/1, test.xxx.com/admin/factories. We want some paths to proxy to asynqmon, like test.xxx.com/admin/asynqmon/asynqmon/redis, ...

Why we need a path prefix '/admin'? Because those requests without path prefix will lead to another application B.

It likes that the asynqmon is a part of the management platform.

If we clone the project and we change the base path and server path, and then we build and deploy asynqmon, this may be done. But we think that adding the proxy path option is better, so we do not need to change the code of the project.

The server path has this advantage:

  1. The nginx can do basic auth depending on the path prefix;
  2. The nginix can do the ip white list depending on the path prefix.
  3. Make the applications more organizational.

So the server path should be better to include all path that asynqmon provides, like /static, /api ... For example, if we add option(option or environment variable) like --server-path="/admin/asynqmon", all paths have this prefix. Maybe should change the build process of the react.

Thanks for consideration.

@flamedmg
Copy link

I have the same issue, i tried to use asynqmon as a docker image and bind it to:
/asynqmon
Html loads just fine, but app requests all it's resources from the root
CleanShot 2021-09-22 at 19 59 03@2x

@hibiken
Copy link
Owner

hibiken commented Sep 23, 2021

Ok let me looking into this in the coming weeks! If this is urgent, please feel free to open a PR!

@lufishggg
Copy link
Author

Thanks!

@NX-Official
Copy link

I met the same situation, is there any progress today?

@hellowords
Copy link

add nginx location

  location ^~/api/monitoring/tasks {
    proxy_pass http://127.0.0.1:3001;
    proxy_redirect             off;
    proxy_set_header           Host             $host;
    proxy_set_header           X-Real-IP        $remote_addr;
    proxy_set_header           X-Forwarded-For  $proxy_add_x_forwarded_for;
  }

@giangnh13579
Copy link

I'm in the same situation, is this available now

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

6 participants