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

Question migrate Apache httpd to spring gateway #3349

Open
mailsanchu opened this issue Apr 10, 2024 · 6 comments
Open

Question migrate Apache httpd to spring gateway #3349

mailsanchu opened this issue Apr 10, 2024 · 6 comments
Labels

Comments

@mailsanchu
Copy link

Hello,
I am trying to migrate the following apache httpd rule to spring gateway. So far it appears to be not working. Can you please lend me a helping hand?

ProxyPassMatch ^(\/v1)?\/rest\/v\/([^\/]+)\/m\/([^\/]+)\/path\/from\/(-?\d+\.?\d*),(-?\d+\.?\d*)\/to\/(-?\d+\.?\d*),(-?\d+\.?\d*)(\?.*)?$ http://localhost:8080/api/v1/public/v/$2/m/$3/path/from/$4,$5/to/$6,$7

@mailsanchu
Copy link
Author

mailsanchu commented Apr 10, 2024

An example would be /rest/v/101/path/from/-10,10/to/20,-20

@mailsanchu
Copy link
Author

mailsanchu commented Apr 10, 2024

    - id: v1_u_me_v_messages
      uri: http://localhost:8082
      predicates:
     `   - Path=/rest/v/{a:\d+}/path/m/{b:\d+}/path/from//{c:\d+},{d:\d+}/to/{e:\d+},{f:\d+}`

@mailsanchu
Copy link
Author

Comma seems to have an issue there

@spencergibb
Copy link
Member

Is the == a typo?

All I can really do is point you at the path pattern javadoc, which gives the most detailed explaination of the syntax https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/util/pattern/PathPattern.html

@mailsanchu
Copy link
Author

Yes it is a typo. I need to extract fields separated by comma and process it internally. I was hoping somebody had a better solution

@mailsanchu
Copy link
Author

Thank you for your response @spencergibb

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

No branches or pull requests

2 participants