Rewrite uri or similar in Akamai - cdn

I have an angular + springboot app and would like to use Akamai as our CDN going forward. We have this setup in our current CDN.
If request uri does not contains extension, then rewrite the uri i.e. replace(‘/folder.*/‘ ,’folder/index.html’) and return the request.
Is there something similar that i can set up in Akamai?

Related

Aurelia + Whatwg-fetch: Call wrong API service

I'm developing a web application with Aurelia. I had a problem with Aurelia and Whatwg-fetch.
The API's relative url is api/post/load/{id}. When I use the fetch client to call this API, I think it gets the current url to call (http://localhost:9000/detail/api/post/load/{id}). I don't know why it happens. Sometime it calls the API's url correctly, other times it does not.
The url at which you access your app is http://localhost:9000/details. Since you didn't include a hashmark (#) in it, I assume the details part is not added by Aurelia, which leads me to believe that you access the app itself at /details.
If that is the case, the problem is that by not prefixing your API's url with a slash (/), the resulting url will be base url+api url, that is, localhost:9000/details + api/post/load/id. The slash between details and api is added on your behalf while constucting the final absolute url. In this case, all you need to do is to prefix the api url with a slash, like so: /api/post/load/{id}.

nginx pass rewritten URL to web server

I'm new to nginx, and I'd like to know if there is a way to pass an edited request URL to a web server. For example, I may have a web server running (Let's say apache. Or Flask.). I want all requests to /foo/(.*)$ to go to my web server, but I want my web server to see them without the foo. But if the initial request didn't have the foo, it would go somewhere else completely.
A request to /foo/bar would be routed to my web server, which would see the request simply as "/bar". However, a request that originally was made to "/bar" would be handled differently entirely. (So I don't just want to redirect).
Is there any way to do this? My thinking is that I could use this to modularize and namespace applications I write, where I could write an application as if it were routing requests on root, but it would actually be buried deeper in my site.
Thanks!!
This should do the trick (untested):
location /foo {
rewrite /[^/](/.*) $1 break;
# Pass to web server, e.g.:
#proxy_pass http://127.0.0.1:8080;
}
Note that the regular expression within the rewrite will strip any sub-directory from the request; but only one sub-directory. You could also use:
rewrite /foo(/.*) $1 break;
Which is more readable and clearer but not as powerful. This is up to you and your regular expression skills.

HTTP redirection without updating document.location

We have a service located at a url like services.example.com/123456/*. We'd like to provide that same service at a url like www.example.com. The original service is provided by a PaaS provider which doesn't work with custom domains.
We want a request to go something like this: browser requests www.example.com/path, we tell it to go to services.example.com/123456/path, and it gets the data from there, but treats the response as if it came from www.example.com/path - so doesn't update document.location or the url at the top, and treats links as relative to the original path.
Is this possible, or would we have to have a own proxy-like website?
You need a proxy that do url rewriting.

URL Rewrite for subdomains in ASP.Net

How can I make URL rewrite rule for this url:
example.com/account/login.aspx
to this url:
me.example.com/login
So any request to the folder /account will rewrite to me.example.com. Also sub folders and file like /account/subfoler/file1.aspx will rewrite to me.example.com/subfolder/file1
I already set the DNS wildcard to the app and all subdomains will take to the same ip address. All I need is the url rewrite rule.
You can achive this in IIS 7.0 Url Rewrite
OR
Write your own handler to intercept incoming request
To achieve this you can implement the IHttpHandler and process the url redirection logic in t he ProcessRequest method
Here is a very good example http://www.codeproject.com/Articles/30907/The-Two-Interceptors-HttpModule-and-HttpHandlers

URL rewriting - outgoing rules

I'm new to the url rewrite module in IIS7, but I managed to add incoming rules and they work well.
Now I want to add outgoing rules to modify the urls in the served pages to reflect the new url scheme. Is there any way to set outbound rules like I set the inbound rules, with a rewrite map?
I looked, but couldn`t find an option to do that.

Resources