You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/19 02:48:30 UTC

[GitHub] [apisix-dashboard] ltt1987 opened a new issue #2219: 添加当反向代理dashboard时,自定义子路径的支持

ltt1987 opened a new issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219


   # Feature request
   
   当前如需反向代理到apisix dashboard,只能进行根目录的代理,如果指定 http://host/dashboard/ 的二级目录进行代理,代理后dashboard 中的静态资源路径、请求的api接口路径,均为根路径(src="/favicon.png")的引用,期望的地址应该是二级目录(src="/dashboard/favicon.png")地址。
   
   ## Describe the solution you'd like
   
   建议增加可指定子路径的功能,类似pgAdmin中,通过增加添加自定义Header X-Script-Name 来指定目录。
   
   ## Additional context
   
   > pgAdmin 实现方式的参考:If you wish to host pgAdmin under a subdirectory rather than on the root of the server, you must specify the location and set the X-Script-Name header which tells the pgAdmin container how to rewrite paths:
   
   ```
   server {
       listen 80;
       server_name _;
   
       location /pgadmin4/ {
           proxy_set_header X-Script-Name /pgadmin4;
           proxy_set_header Host $host;
           proxy_pass http://localhost:5050/;
           proxy_redirect off;
       }
   }
   ```
   
   


-- 
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



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #2219: 添加当反向代理dashboard时,自定义子路径的支持

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-973713176


   Not sure if it's supported with Apache APISIX 🤔 @tzssangglass could you please have a check?


-- 
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



[GitHub] [apisix-dashboard] ltt1987 commented on issue #2219: Add sub_path support when dashboard under a subdirectory via nginx reverse proxy.

Posted by GitBox <gi...@apache.org>.
ltt1987 commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-973813617


   > BTW, @ltt1987 I recommend using English here 😄 For we have many contributors and users who speak English and other languages 😄
   
   Sorry for that, I'm not good at english. I have added English content, but I still keep Chinese in order to avoid wrong description.


-- 
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



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #2219: Add sub_path support when dashboard under a subdirectory via nginx reverse proxy.

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-983177783


   see https://pro.ant.design/zh-CN/config/config#publicpath


-- 
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



[GitHub] [apisix-dashboard] bzp2010 commented on issue #2219: Add sub_path support when dashboard under a subdirectory via nginx reverse proxy.

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-982823101


   Hi, @ltt1987.
   
   I think the problem is that the compilation product of our dashboard project currently uses absolute paths to load resources, so you need to recompile if you want to proxy dashboard in a subdirectory. These are not directly supported by either the Manager API or the `proxy-rewrite` plugin in APISIX.
   
   Of course, we can take some measures to improve it, if you are willing to try.
   
   Here are the configures about it.
   [https://github.com/apache/apisix-dashboard/blob/d7b772235f1a13660541e6f52c4844a3bb7929f6/web/config/config.ts#L48-L49](https://github.com/apache/apisix-dashboard/blob/d7b772235f1a13660541e6f52c4844a3bb7929f6/web/config/config.ts#L48-L49)


-- 
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



[GitHub] [apisix-dashboard] adoal commented on issue #2219: Add sub_path support when dashboard under a subdirectory via nginx reverse proxy.

Posted by GitBox <gi...@apache.org>.
adoal commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-982595185


   > we cau use `proxy-rewrite` plugins to do this, refer to:[apache/apisix#3252](https://github.com/apache/apisix/issues/3252)
   
   I don't think `proxy-rewrite` helps, since it only strips the prefix then sends to the backend server, but we also need some mechanism to tell the backend so it will 'know' it should generate anchor URLs under some prefix. Just like `SCRIPT_NAME` and `PATH_INFO` in traditional CGI spec.


-- 
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



[GitHub] [apisix-dashboard] tzssangglass commented on issue #2219: Add sub_path support when dashboard under a subdirectory via nginx reverse proxy.

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-974598216


   we cau use `proxy-rewrite` plugins to do this, refer to:https://github.com/apache/apisix/issues/3252


-- 
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



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #2219: 添加当反向代理dashboard时,自定义子路径的支持

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-973714758


   BTW, @ltt1987 I recommend using English here 😄 For we have many contributors and users who speak English and other languages 😄


-- 
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



[GitHub] [apisix-dashboard] tzssangglass commented on issue #2219: Add sub_path support when dashboard under a subdirectory via nginx reverse proxy.

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-974598216


   we cau use `proxy-rewrite` plugins to do this, refer to:https://github.com/apache/apisix/issues/3252


-- 
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



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #2219: Add sub_path support when dashboard under a subdirectory via nginx reverse proxy.

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-974024829


   got it, @bzp2010 would you please take a look?


-- 
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



[GitHub] [apisix-dashboard] tzssangglass commented on issue #2219: Add sub_path support when dashboard under a subdirectory via nginx reverse proxy.

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #2219:
URL: https://github.com/apache/apisix-dashboard/issues/2219#issuecomment-982600110


   > since it only strips the prefix then sends to the backend server
   
   APISIX does not modify the url by default.


-- 
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