You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何修改Apache Superset服务器部署URL中的superset路径标识?

How to Customize Apache Superset's Base URL Path (Replace /superset with /new-name)

Hey there! I've tackled this exact problem before, so let me share the proper, maintainable solutions to change Superset's base URL path without modifying the source code (which is not recommended, as you found out):

1. Configure Superset's Internal Base URL

First, you need to tell Superset itself to use the new path for internal routing and resource links. This is done via the superset_config.py file:

  • Locate your superset_config.py (usually in ~/.superset/ or the directory you specified during setup)
  • Add or update this line:
    SUPERSET_WEBSERVER_BASEURL = "/new-name"
    
  • Save the file and restart your Superset web server (e.g., superset run -p 8088 --with-threads --reload or restart the Docker container if using Docker)

If you're using Docker, you can set this as an environment variable instead of editing the config file. Add this to your docker-compose.yml under the superset service:

environment:
  - SUPERSET_WEBSERVER_BASEURL=/new-name

2. Set Up a Reverse Proxy (e.g., Nginx)

Even with the internal config set, you'll need a reverse proxy to map incoming requests to /new-name to Superset's default /superset endpoint. Here's an example Nginx configuration:

server {
    listen 80;
    server_name name.domain.com;

    location /new-name/ {
        # Pass requests to Superset's default port
        proxy_pass http://localhost:8088/superset/;
        # Preserve host headers for proper routing
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        # Fix path issues by rewriting the request URI
        rewrite ^/new-name/(.*)$ /superset/$1 break;
    }
}
  • Make sure the trailing slashes are correct (both in location and proxy_pass) to avoid path mismatches
  • Restart Nginx after applying the config: sudo systemctl restart nginx

Common Pitfalls to Avoid

  • Don't modify source code: This will break future updates and is unsupported. Stick to official config options.
  • Restart all services: After changing superset_config.py or Docker env vars, you must restart Superset. For Nginx, a restart is also required.
  • Check static resources: If CSS/JS isn't loading, double-check that SUPERSET_WEBSERVER_BASEURL is set correctly—Superset uses this to generate links to static assets.

After completing these steps, your Superset instance should be accessible at http://name.domain.com/new-name/welcome as desired!

内容的提问来源于stack exchange,提问作者pcsafiya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 09:04:22