Skip to content

feat: support configuring the base path#2603

Open
rgelinas-polygon wants to merge 1 commit intosafe-global:mainfrom
rgelinas-polygon:support-base-path
Open

feat: support configuring the base path#2603
rgelinas-polygon wants to merge 1 commit intosafe-global:mainfrom
rgelinas-polygon:support-base-path

Conversation

@rgelinas-polygon
Copy link

@rgelinas-polygon rgelinas-polygon commented Aug 6, 2025

Make sure these boxes are checked! 📦✅

  • You ran ./run_tests.sh
  • You ran pre-commit run -a
  • If you want to add your network to setup_service.py, provide a link to your
    safe-deployments PR and check network name
    exists in safe-eth-py

What was wrong? 👾

We are looking to proxy many transaction services behind a single domain - because there are redirects (swagger functionality, Django appending slashes and redirecting by default, etc.), we need to change the base path of the app. We experimented with the FORCE_SCRIPT_NAME option added in #400, but it did not solve the problem for us. Changing the script name adjusted the base domain rather than solely the base path Django expects to use.

How was it fixed? 🎯

I simply added a new environment variable called DJANGO_BASE_PATH that fills out the BASE_PATH setting, and ensured that all URLs were prefixed by the base path. By default the base path is empty, and nothing changes.

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@rgelinas-polygon
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@moisses89
Copy link
Member

moisses89 commented Sep 1, 2025

@rgelinas-polygon could you try configuring the prefix midleware header from your proxy?
#2556

cryptobuks pushed a commit to groundbasesoft/cla-signatures that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants