[GH-ISSUE #3732] [bug]: 404 when ENABLE_SUBPATH_BASED_ACCESS=true #1293

Closed
opened 2026-03-16 19:40:46 +03:00 by kerem · 3 comments
Owner

Originally created by @mstimvol on GitHub (Jan 8, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3732

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

I've the following env file:

ADMIN_EMAIL=my@admin.tld
ADMIN_PASSWORD=SomePass
DATABASE_URL=postgresql://hoppscotch:Hoppscotch1234!@hoppscotchdb:5432/hoppscotch?connect_timeout=300
JWT_SECRET=your-password
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY=3
REFRESH_TOKEN_VALIDITY=604800000
ACCESS_TOKEN_VALIDITY=86400000
SESSION_SECRET=your-password
REDIRECT_URL=https://my-hoppscotch.some.tld
WHITELISTED_ORIGINS=https://my-hoppscotch.some.tld,https://my-hoppscotch.some.tld/admin
VITE_ALLOWED_AUTH_PROVIDERS='EMAIL'
MAILER_SMTP_URL=smtp://my-mail-server:25/?skip_ssl_verify=true&legacy_ssl=false&smtp_ssl_enabled=false&disable_starttls=true
MAILER_ADDRESS_FROM='Hoppscotch'
RATE_LIMIT_TTL=60
RATE_LIMIT_MAX=100
VITE_BASE_URL=https://my-hoppscotch.some.tld
VITE_SHORTCODE_BASE_URL=https://my-hoppscotch.some.tld
VITE_ADMIN_URL=https://my-hoppscotch.some.tld/admin
VITE_BACKEND_GQL_URL=https://my-hoppscotch.some.tld/backend/graphql
VITE_BACKEND_WS_URL=wss://my-hoppscotch.some.tld/backend/graphql
VITE_BACKEND_API_URL=https://my-hoppscotch.some.tld/backend/v1
VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms
VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy
ENABLE_SUBPATH_BASED_ACCESS=true

And my docker-compose file looks like:

  hoppscotch:
    image: hoppscotch/hoppscotch:latest
    container_name: hoppscotch
    env_file:
      - ./.env
    environment:
      VIRTUAL_HOST: my-hoppscotch.some.tld
      VIRTUAL_PORT: 3000
      LETSENCRYPT_HOST: my-hoppscotch.some.tld
    restart: unless-stopped
    networks:
      - proxy

  hoppscotchdb:
    image: postgres:15
    container_name: hoppscotchdb
    restart: unless-stopped
    environment:
      POSTGRES_USER: "hoppscotch"
      POSTGRES_PASSWORD: "Hoppscotch1234!"
      POSTGRES_DATABASE: "hoppscotch"
    networks:
      - proxy

I want being able to access hoppscotch using subpaths (https://docs.hoppscotch.io/documentation/self-host/enterprise-edition/install-and-build#subpath-based-access), but when I try to access hoppscotch, I'm always getting a 404 page. When I set ENABLE_SUBPATH_BASED_ACCESS=false, it works. I also tried the tag 2023.12.0 because https://github.com/hoppscotch/hoppscotch/pull/3449 seems to be part of it but still the same 404 error. Any idea what I'm doing wrong here?

I assume it's a bug because when I set ENABLE_SUBPATH_BASED_ACCESS=false I can access hoppscotch without any issue.

Steps to reproduce

  1. Add the ENABLE_SUBPATH_BASED_ACCESS to your hoppscotch .env file and set it true
  2. Start your hoppscotch container
  3. Run migrations (pnpx prisma migrate deploy)
  4. Try to access your hoppscotch instance

Environment

Production

Version

Self-hosted

Originally created by @mstimvol on GitHub (Jan 8, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3732 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior I've the following env file: ```env ADMIN_EMAIL=my@admin.tld ADMIN_PASSWORD=SomePass DATABASE_URL=postgresql://hoppscotch:Hoppscotch1234!@hoppscotchdb:5432/hoppscotch?connect_timeout=300 JWT_SECRET=your-password TOKEN_SALT_COMPLEXITY=10 MAGIC_LINK_TOKEN_VALIDITY=3 REFRESH_TOKEN_VALIDITY=604800000 ACCESS_TOKEN_VALIDITY=86400000 SESSION_SECRET=your-password REDIRECT_URL=https://my-hoppscotch.some.tld WHITELISTED_ORIGINS=https://my-hoppscotch.some.tld,https://my-hoppscotch.some.tld/admin VITE_ALLOWED_AUTH_PROVIDERS='EMAIL' MAILER_SMTP_URL=smtp://my-mail-server:25/?skip_ssl_verify=true&legacy_ssl=false&smtp_ssl_enabled=false&disable_starttls=true MAILER_ADDRESS_FROM='Hoppscotch' RATE_LIMIT_TTL=60 RATE_LIMIT_MAX=100 VITE_BASE_URL=https://my-hoppscotch.some.tld VITE_SHORTCODE_BASE_URL=https://my-hoppscotch.some.tld VITE_ADMIN_URL=https://my-hoppscotch.some.tld/admin VITE_BACKEND_GQL_URL=https://my-hoppscotch.some.tld/backend/graphql VITE_BACKEND_WS_URL=wss://my-hoppscotch.some.tld/backend/graphql VITE_BACKEND_API_URL=https://my-hoppscotch.some.tld/backend/v1 VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy ENABLE_SUBPATH_BASED_ACCESS=true ``` And my docker-compose file looks like: ```yaml hoppscotch: image: hoppscotch/hoppscotch:latest container_name: hoppscotch env_file: - ./.env environment: VIRTUAL_HOST: my-hoppscotch.some.tld VIRTUAL_PORT: 3000 LETSENCRYPT_HOST: my-hoppscotch.some.tld restart: unless-stopped networks: - proxy hoppscotchdb: image: postgres:15 container_name: hoppscotchdb restart: unless-stopped environment: POSTGRES_USER: "hoppscotch" POSTGRES_PASSWORD: "Hoppscotch1234!" POSTGRES_DATABASE: "hoppscotch" networks: - proxy ``` I want being able to access hoppscotch using subpaths (https://docs.hoppscotch.io/documentation/self-host/enterprise-edition/install-and-build#subpath-based-access), but when I try to access hoppscotch, I'm always getting a 404 page. When I set `ENABLE_SUBPATH_BASED_ACCESS=false`, it works. I also tried the tag 2023.12.0 because https://github.com/hoppscotch/hoppscotch/pull/3449 seems to be part of it but still the same 404 error. Any idea what I'm doing wrong here? I assume it's a bug because when I set `ENABLE_SUBPATH_BASED_ACCESS=false` I can access hoppscotch without any issue. ### Steps to reproduce 1. Add the `ENABLE_SUBPATH_BASED_ACCESS` to your hoppscotch .env file and set it true 2. Start your hoppscotch container 3. Run migrations (`pnpx prisma migrate deploy`) 4. Try to access your hoppscotch instance ### Environment Production ### Version Self-hosted
kerem 2026-03-16 19:40:46 +03:00
Author
Owner

@mstimvol commented on GitHub (Jan 8, 2024):

After reviewing the Caddyfile I got the idea... the reason I'm getting 404 is that I'm trying to access port 3000. Instead of this, I've to use port 80. I wasn't aware about this difference. So no bug... just my ignorance, sorry!

<!-- gh-comment-id:1881428863 --> @mstimvol commented on GitHub (Jan 8, 2024): After reviewing the Caddyfile I got the idea... the reason I'm getting 404 is that I'm trying to access port 3000. Instead of this, I've to use port 80. I wasn't aware about this difference. So no bug... just my ignorance, sorry!
Author
Owner

@musuyaba commented on GitHub (Sep 1, 2024):

I'm sorry. Could you please confirm if you've also updated the .env file? Perhaps with values like these?

VITE_BASE_URL=http://localhost
VITE_SHORTCODE_BASE_URL=http://localhost
VITE_ADMIN_URL=http://localhost
VITE_BACKEND_GQL_URL=http://localhost
VITE_BACKEND_WS_URL=ws://localhost
VITE_BACKEND_API_URL=http://localhost
<!-- gh-comment-id:2323212040 --> @musuyaba commented on GitHub (Sep 1, 2024): I'm sorry. Could you please confirm if you've also updated the .env file? Perhaps with values like these? ```bash VITE_BASE_URL=http://localhost VITE_SHORTCODE_BASE_URL=http://localhost VITE_ADMIN_URL=http://localhost VITE_BACKEND_GQL_URL=http://localhost VITE_BACKEND_WS_URL=ws://localhost VITE_BACKEND_API_URL=http://localhost ```
Author
Owner

@boiyelove commented on GitHub (Sep 18, 2024):

I'm sorry. Could you please confirm if you've also updated the .env file? Perhaps with values like these?

VITE_BASE_URL=http://localhost
VITE_SHORTCODE_BASE_URL=http://localhost
VITE_ADMIN_URL=http://localhost
VITE_BACKEND_GQL_URL=http://localhost
VITE_BACKEND_WS_URL=ws://localhost
VITE_BACKEND_API_URL=http://localhost

@musuyaba are you saying that when using a custom tld, the VITE...URLS still need to be localhost?

<!-- gh-comment-id:2357236513 --> @boiyelove commented on GitHub (Sep 18, 2024): > I'm sorry. Could you please confirm if you've also updated the .env file? Perhaps with values like these? > > ```shell > VITE_BASE_URL=http://localhost > VITE_SHORTCODE_BASE_URL=http://localhost > VITE_ADMIN_URL=http://localhost > VITE_BACKEND_GQL_URL=http://localhost > VITE_BACKEND_WS_URL=ws://localhost > VITE_BACKEND_API_URL=http://localhost > ``` @musuyaba are you saying that when using a custom tld, the VITE...URLS still need to be localhost?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1293
No description provided.