You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "SKDragon18 (via GitHub)" <gi...@apache.org> on 2025/04/21 01:36:51 UTC

[I] help request: config APISIX with website [apisix]

SKDragon18 opened a new issue, #12163:
URL: https://github.com/apache/apisix/issues/12163

   ### Description
   
   Hi, I'm configuring APISIX to route requests from domain-apisix/service1/webui/* to localhost:8000/* using URL rewrite.
   
   However, the problem is that the frontend app uses relative paths like ./static/file.js to load JS files. As a result, the browser tries to fetch from domain-apisix/static/file.js, which does not exist (it should be domain-apisix/service1/webui/static/file.js instead).
   
   Is there any way to fix this using only APISIX configuration, without modifying the frontend?
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] help request: config APISIX with website [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #12163:
URL: https://github.com/apache/apisix/issues/12163#issuecomment-2896456492

   If there is still a problem, please open it again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] help request: config APISIX with website [apisix]

Posted by "SKDragon18 (via GitHub)" <gi...@apache.org>.
SKDragon18 commented on issue #12163:
URL: https://github.com/apache/apisix/issues/12163#issuecomment-2819608983

   @darkSheep404 , Thank you for support. 
   This is the first way I tried, it seems that the website records it is domain-apisix/static/xxx.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] help request: config APISIX with website [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #12163: help request: config APISIX with website
URL: https://github.com/apache/apisix/issues/12163


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] help request: config APISIX with website [apisix]

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #12163:
URL: https://github.com/apache/apisix/issues/12163#issuecomment-2817996552

   try rewrite domain-apisix/service1/webui/static to localhost:8000/static/xxx ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] help request: config APISIX with website [apisix]

Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on issue #12163:
URL: https://github.com/apache/apisix/issues/12163#issuecomment-2820183795

   @SKDragon18 Can you try add a base tag like this?
   ```bash
     "plugins": {
       "proxy-rewrite": {
         "regex_uri": ["^/service1/webui/(.*)", "/$1"]
       },
       "response-rewrite": {
         "filters": [
           {
             "regex": "<head>",
             "replace": "<head><base href=\"/service1/webui/\">",
             "scope": "once",  # Replace only the first occurrence
             "options": "jo"   # Regex options (JIT + compile Once)
           }
         ]
       }
     },
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org