URL rewrite on an Azure Website to another server

Lillvik

I have an Ember application that is using CORS to access APIs on different subdomains. Since IE8 and IE9 don't have full CORS support I need to create a proxy to access the APIs.

The Ember application is deployed on an Azure Website and the API's are Web Roles. I have tried to create a proxy using URL rewrite but I only get a 404 Not Found.

I would like the following behavior

https://www.cloudstorez.com/rewrite/cms/public/designs

Rewrites to

https://cms-public.cloudstorez.com/designs

The URL rewrite looks like this

<rule name="Rewrite to APIs" stopProcessing="true">
    <match url="^rewrite/([^/]*)/([^/]*)/(.*)" />
    <action type="Rewrite" url="https://{R:1}-{R:2}.cloudstorez.com/{R:3}" />
</rule>

If I instead do a corresponding redirect it works fine.

<rule name="Redirect to APIs" stopProcessing="true">
    <match url="^redirect/([^/]*)/([^/]*)/(.*)" />
    <action type="Redirect" url="https://{R:1}-{R:2}.cloudstorez.com/{R:3}" />
</rule>

Is there something wrong in my rewrite or are there restrictions on Azure Websites regarding URL rewrites or accessing other servers?

astaykov

Rewriting to External URLs is called Reverse Proxy. This functionality is achieved in a combination of ARR + Url Rewrite. These are two separate modules of IIS.

Reverse Proxy is not enabled by default on Azure Web Sites. But there is a trick to enabled it. Ruslan Y. from IIS Team (or former IIS team) has written a blog post on how to enable reverse proxy on Azure Web Sites here.

Note - I haven't personally tested the trick, so cannot say if it still works (Azure Web Sites has much evolved since Ruslan's blog and this feature might have been disabled), but still worth giving it a try.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

URL rewrite on an Azure Website to another server

From Dev

Url rewrite Azure PHP?

From Dev

htaccess for rewrite URL is not working for my website

From Dev

htaccess for rewrite URL is not working for my website

From Dev

how to rewrite url in .htaccess for a multilingual website

From Dev

URL Rewrite - Internal server error

From Dev

url rewrite working on local but not on server

From Dev

Rewrite dynamic URL to another dynamic URL

From Dev

Rails view URL to another website

From Dev

Redirecting a url with a path to another website

From Dev

htaccess URL rewrite - requested URL not found on server

From Dev

Unable to Rewrite URL Linux server ( URL rewriting )

From Dev

when remove website to another server?

From Dev

SQL Server CE on Azure website

From Dev

URL rewrite to another folder and file for specific requests

From Dev

IIS URL Rewrite subfolder to another folder name

From Dev

mod_rewrite copy parameters to another url

From Dev

Rewrite rule: change a portion of text in URL to another

From Dev

rewrite rule forward one url to another wordpress

From Dev

Azurewebsite django URL rewrite for another application

From Dev

Mod_rewrite proxy reverse, serve content from another website

From Dev

azure website rewrite rule in web.config to redirect .net to .com

From Dev

npm http server during development and rewrite url

From Dev

How to rewrite URL to match a server using nginx?

From Dev

IIS: Use Application Request Routing for URL Rewrite outside of Default Website

From Dev

How to rewrite URL in multi-lingual ASP.NET website

From Dev

URL Rewrite for website subjects and eliminate www at the same time

From Dev

URL Rewrite to external website not working on IIS 8.5 but works on IIS 7.5

From Dev

How to rewrite URL after redirect to another url using .htaccess

Related Related

  1. 1

    URL rewrite on an Azure Website to another server

  2. 2

    Url rewrite Azure PHP?

  3. 3

    htaccess for rewrite URL is not working for my website

  4. 4

    htaccess for rewrite URL is not working for my website

  5. 5

    how to rewrite url in .htaccess for a multilingual website

  6. 6

    URL Rewrite - Internal server error

  7. 7

    url rewrite working on local but not on server

  8. 8

    Rewrite dynamic URL to another dynamic URL

  9. 9

    Rails view URL to another website

  10. 10

    Redirecting a url with a path to another website

  11. 11

    htaccess URL rewrite - requested URL not found on server

  12. 12

    Unable to Rewrite URL Linux server ( URL rewriting )

  13. 13

    when remove website to another server?

  14. 14

    SQL Server CE on Azure website

  15. 15

    URL rewrite to another folder and file for specific requests

  16. 16

    IIS URL Rewrite subfolder to another folder name

  17. 17

    mod_rewrite copy parameters to another url

  18. 18

    Rewrite rule: change a portion of text in URL to another

  19. 19

    rewrite rule forward one url to another wordpress

  20. 20

    Azurewebsite django URL rewrite for another application

  21. 21

    Mod_rewrite proxy reverse, serve content from another website

  22. 22

    azure website rewrite rule in web.config to redirect .net to .com

  23. 23

    npm http server during development and rewrite url

  24. 24

    How to rewrite URL to match a server using nginx?

  25. 25

    IIS: Use Application Request Routing for URL Rewrite outside of Default Website

  26. 26

    How to rewrite URL in multi-lingual ASP.NET website

  27. 27

    URL Rewrite for website subjects and eliminate www at the same time

  28. 28

    URL Rewrite to external website not working on IIS 8.5 but works on IIS 7.5

  29. 29

    How to rewrite URL after redirect to another url using .htaccess

HotTag

Archive