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

How to Configure URI-based Routing for River #83

Open
noir19 opened this issue Oct 9, 2024 · 0 comments
Open

How to Configure URI-based Routing for River #83

noir19 opened this issue Oct 9, 2024 · 0 comments

Comments

@noir19
Copy link

noir19 commented Oct 9, 2024

Hello,

I'm trying to set up URI-based routing in this reverse proxy project. Specifically, I want to route requests to different backend servers based on the URI path. However, I haven't been able to find clear documentation or examples on how to achieve this.

In Nginx, this can be done with a configuration like:

nginx

server {
        listen       80;
        server_name  app;
        include  /etc/nginx/conf.d/variable.conf;

        #charset koi8-r;

        location / {
            root  /etc/nginx/webapp/app;
            index  index.html index.htm;
            #try_files $uri $uri/ /app/index.html;
            gzip_static on;
        }

        location /app {
            alias  /etc/nginx/webapp/app;
            index  index.html index.htm;
            #try_files $uri $uri/ /index.html;
        }

        location /api {
            proxy_pass http://$lb;
            proxy_set_header Host $host;
            proxy_set_header X-Real_IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location ~* ^/oss/ {
            proxy_set_header X-NginX-Proxy true;
            real_ip_header X-Real-IP;

            rewrite ^/oss/(.*) /$1 break;
            proxy_pass http://$oss_server;
        }

        include  /etc/nginx/conf.d/gaode.conf;
        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

This allows different parts of an application (e.g., frontend, API, authentication) to be served by different backend servers, all through a single reverse proxy.

Is this feature currently supported in this project? If so, could you please provide an example configuration or point me to the relevant documentation?

If this feature is not currently supported, I'd like to request its addition as I believe it would greatly enhance the flexibility and usefulness of this project, allowing it to be used in more complex deployment scenarios.

Thank you for your help and consideration.

@noir19 noir19 changed the title How to Configure URI-based Routing for Reverse Proxy How to Configure URI-based Routing for river Oct 9, 2024
@noir19 noir19 changed the title How to Configure URI-based Routing for river How to Configure URI-based Routing for River Oct 9, 2024
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