I have a spring-cloud project with zuul gateway.
I told the gateway to route any request from /book-api/** to book-service (rest) by specifying property below in gateway.properties:
zuul.routes.book-service.path=/book-api/**
But it leads me to duplicate api. I able to access same service from both /book-service/getBook and book-api/getBook paths rather than access it from /book-api/getBook path only.
Should I made filter for hiding /book-service/** path?
Please try to add the below property
zuul.ignored-services=*
All services are added into Zuul routes automatically as default. You can disable it with the above property.
You can find more detail in 'Embedded Zuul Reverse Proxy' section of the document
Related
If you run an application on Cloud Run and deployed container by opening this URL in a web browser the URL comes like this:
this_cloud_run_format.run.app
Can this URL be customized and how ?
Google Cloud Run does not support changing the auto-generated service URL.
You can set up a custom domain using Cloud Run Domain Mapping.
Mapping custom domains
You will need to own/control the domain and be able to create resource records at the authoritative name servers (DNS server) for the domain.
Using the angular 2 debug server, I proxy requests to the real server using proxy.config.js. It seems that the ng2-signalr library does not respect the proxy configuration, and will attempt requests to whatever was defined as url in the IConnectionOptions used.
for the following request:
GET
localhost:4200/signalr/negotiate?clientProtocol=2.1&user=client&connectionData=%5B%7B%22name%22%3A%22compilationhub%22%7D%5D&_=1557816148076
the following error is produced:
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https
What would be the best course of action?
I got this working by adding the signalr route to proxy.config.js and setting the url property of my IConnectionOptions to location.origin. This setup bypasses the default route of /signalr so that a double forward slash route is not used.
How can i set a path prefix for scdf UI. I already set the tomcat property (like server.contextPath=/api/) which works for the rest API but the UI is still giving errors.
Info: i have it running in Kubernetes using ingress.
We do not support GUI redirects with a overridden contextPath. The Dashboard is a SPA and this type of interaction requires special handling from the client-side.
Feel free to open an issue and consider also contributing to the project.
When Zuul routes a request to, say, login page, the static resources (css, js etc.) cannot be correctly located. A 404 Not Found error will be returned.
I have the following routing setting first:
ui:
path: /ui/**
url: http://serviceHost:8082/ui/
And it's working well. So when I visit http://zuulHost/ui/login/, I'll get an index.jsp and then the browser will request the static resources, whose paths are like:
/ui/ext/ext-dev.js
The browser will use http://zuulHost/ui/ext/ext-dev.js, for e.g, for that resource. And Zuul will route it to http://serviceHost:8082/ui/ext/ext-dev.js according to its setting.
But then I want to forward the request to the root / path to the login page, and I added:
root:
path: /
url: http://serviceHost:8082/ui/login/
This time, after the browser gets the index.jsp file, it will request the resources using:
http://zuulHost/ext/ext-dev.js
So in this case, the context /ui is lost, because the browser doesn't know about it since I'm forwarding the request in zuul internally. The url in the browser is still http://zuulHost. And zuul won't know where to route http://zuulHost/ext/ext-dev.js, since there's not a match in its routing table.
I wonder if there's a solution to it. I think it's a quite common issue when doing forwarding in proxy servers. Thanks.
We've developed a Grails application that uses redirects.
Beacuse of external reasons, we are just recently using reverse-proxy, to split some traffic to domains:
From:
demo1.company.local (the server itself)
To:
tomcat.company.local (for all java applications, including our grails app)
lotus.company.local (for all Domino applications)
Since tomcat is only configured in the hosts file on the demo1 server, the redirects do not work when I access the application from anywhere else then the demo1 server itself.
I've tried to solve this using "absolute" and/or "base" parameter in Grails' redirect(), but if I understand correctly, this is Grails 2+ only and we're using Grails 1.3.4.
Are there other ways to redirect to a specified host?
Am I misusing things?
Thanks,
Bram
If you define grails.serverURL in Config.groovy, redirects with absolute:true will use that value for the URL.