Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在 apollo-portal统一增加访问路径的前缀/apollo 时,导入配置的请求url 有部分没有添加前缀 #5137

Closed
xworks opened this issue May 4, 2024 · 3 comments · May be fixed by #5138
Labels

Comments

@xworks
Copy link

xworks commented May 4, 2024

描述bug

在 apollo-portal统一增加访问路径的前缀/apollo 时,导入配置的请求url 有部分没有添加前缀,导致无法导入配置

复现

通过如下步骤可以复现:

  1. 在导入配置页面,选择要导入的环境和要导入的配置 zip 包,点击导入,就会出现报错

期望

导入成功

截图
点击报错:
image

额外的细节和日志

  • 版本:2.2.0
  • 错误日志
  • 配置:
  • 平台和操作系统
Copy link

dosubot bot commented May 4, 2024

To address the issue where some request URLs are missing the /apollo prefix after adding it to the access path in Apollo Portal, causing configuration imports to fail, follow these steps:

  1. For Apollo Portal version 1.7.0 and above:

    • Ensure you've added the -D parameter server.servlet.context-path=/apollo or the system environment variable SERVER_SERVLET_CONTEXT_PATH=/apollo for apollo-portal.
    • Update your nginx/slb configuration to forward requests correctly. Here's an nginx configuration example:
      location /apollo/ {
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_pass http://127.0.0.1:8070/apollo/;
      }
  2. For Apollo Portal version 1.6.0 and above:

    • Add the prefix.path=/apollo configuration parameter to the portal through the Administrator Tools - System Parameters page.
    • Use the following nginx configuration for forwarding:
      location /apollo/ {
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_pass http://127.0.0.1:8070/;
      }

These steps ensure that the /apollo prefix is correctly handled, allowing for successful configuration imports. If the issue persists, please provide the exact error message and any relevant logs for further assistance. Ensure you have correctly added the /apollo prefix as per the recommended approach using server.servlet.context-path.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

Copy link

stale bot commented Jun 4, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 4, 2024
Copy link

stale bot commented Jun 11, 2024

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant