-
Hi, I cannot get URL rewriting to work like I need it to. I am probably missing something small. I need POST service calls matching the path of /service/* to be directed to endpoints hosted by another service on port 80 (the website is hosting on port 8888). This is my config file. I am currently testing without wildcards, using only 1 service endpoint. And this is all local on my windows machine.
the top example works, logo is rewritten to logo2. But the service call always gives a 405 error when it gets called by the javascript in my static website, and it definitely does not call the destination endpoint. I am using the windows prebuilt binary v2.36.0 Any help will be greatly aprpeciated! EDIT: Futher test cases. this works fine
but this does not work
so the rewrites seem to work as long as it rewrites to a URL within the static-web-server, but as soon as change the destination to something external it doesnt work. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, here I address some of your main concerns.
SWS only supports
URL Rewrites supports a URL Rewrites are for local path usage mainly and as I said before, SWS is not a proxy server therefore if you want to bridge requests from SWS to elsewhere then SWS is not for you. |
Beta Was this translation helpful? Give feedback.
-
Thank you for clarifying! |
Beta Was this translation helpful? Give feedback.
Hi, here I address some of your main concerns.
SWS only supports
GET
,HEAD
, andOPTIONS
request methods. That's why you will get405 Method Not Allowed
. See https://static-web-server.net/features/http-methods/URL Rewrites supports a
redirect
option to tell SWS to perform a redirection request when thesource
matches. You could use that option.However, take intβ¦