[GH-ISSUE #4926] [bug]: Admin and backend does not connect when using subpaths in AIO container #1857

Closed
opened 2026-03-16 22:08:01 +03:00 by kerem · 3 comments
Owner

Originally created by @Tabinka on GitHub (Mar 21, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4926

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Current behavior

Hi,

I think this issue have two sides for my case.
I am using docker AIO container behind Nginx proxy server. Well right now it works half to half.
When subpath based access is disabled, front-end is working fine through web browser, but /admin is throwing an error with connecting to backend and I cannot acces my instance through desktop app.

When subpath based access is enabled, on front-end providers for logging in (in this case email) does not load.

Did I miss something or is it a known bug? I saw something similiar in this issue: https://github.com/hoppscotch/hoppscotch/issues/3435
But it does not apply to my case entirely.

Steps to reproduce

  1. Run AIO container in docker compose
  2. Run behind Nginx Proxy
  3. Access web page

This shows when accessing https://hoppscotch.domain.com/admin
Image

This shows browser console on both https://hoppscotch.domain.com even though I am able to log in and use it and https://hoppscotch.domain.com/admin (subpath mode is not enabled):

Image

When subpath is enabled I cannot log in with email provider:

Image

Logs and Screenshots


Environment

Production

Hoppscotch Version

Self-hosted

Interceptor

Browser - Web App

Browsers Affected

Not browser-specific

Operating System

Other (specify in additional info)

Additional Information

Docker version 23.0.1, build a5ee5b1
nginx version: nginx/1.24.0

Container is running in stack.
Snippet of docker-compose.yml:

  hoppscotch:
    image: hoppscotch/hoppscotch:2025.2.2
    env_file:
      - env/hoppscotch.env
    ports:
      - 30011:80
      - 30000:3000
      - 31700:3170
      - 31000:3100
      - 32000:3200

.env file:

#-----------------------Backend Config------------------------------#
# Prisma Config
DATABASE_URL=postgresql://postgres:xxx@database.domain:5432/hoppscotch

HOPP_AIO_ALTERNATE_PORT=80

# Auth Tokens Config
JWT_SECRET=xxx
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY=60
REFRESH_TOKEN_VALIDITY=604800000
ACCESS_TOKEN_VALIDITY=86400000
SESSION_SECRET=xxx

# Recommended to be true. Set to false if you are using http.
# Note: Some auth providers may not support http requests and may stop working when set to false.
ALLOW_SECURE_COOKIES=false

# Sensitive Data Encryption Key while storing in Database (32 character)
DATA_ENCRYPTION_KEY=xxx

# Hoppscotch App Domain Config
REDIRECT_URL=https://hoppscotch.domain.com
WHITELISTED_ORIGINS=https://hoppscotch.domain.com,http://smtprelay.domain.com,https://hoppscotch.domain.com/admin,https://hoppscotch.domain.com/graphql,https://hoppscotch.domain.com/v1,app://hoppscotch.domain.com,http://app.hoppscotch.domain.com
VITE_ALLOWED_AUTH_PROVIDERS=EMAIL

# Mailer config
MAILER_SMTP_ENABLE=true
MAILER_USE_CUSTOM_CONFIGS=true
MAILER_ADDRESS_FROM=support@domain.com

MAILER_SMTP_HOST=smtprelay.domain.com
MAILER_SMTP_PORT=25
MAILER_SMTP_SECURE=false
MAILER_SMTP_USER=support@domain.com
MAILER_SMTP_PASSWORD= 
MAILER_TLS_REJECT_UNAUTHORIZED=false

# Rate Limit Config
RATE_LIMIT_TTL=60
RATE_LIMIT_MAX=100

#-----------------------Frontend Config------------------------------#

# Base URLs
VITE_BASE_URL=https://hoppscotch.domain.com
VITE_SHORTCODE_BASE_URL=https://hoppscotch.domain.com
VITE_ADMIN_URL=https://hoppscotch.domain.com

# Backend URLs
VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/graphql
VITE_BACKEND_WS_URL=wss://hoppscotch.domain.com/graphql
VITE_BACKEND_API_URL=https://hoppscotch.domain.com/v1

# Set to `true` for subpath based access
ENABLE_SUBPATH_BASED_ACCESS=true

Nginx Proxy config:

#
# vhost.d/hoppscotch.domain.com.conf
#

# hoppscotch.domain.com
server {
	listen 80;
	listen [::]:80;
	listen 443 ssl http2;
	listen [::]:443 ssl http2;

	server_name hoppscotch.domain.com;

	include snippet.d/redirect_to_https.conf;
	include snippet.d/log.conf;
	include snippet.d/ssl.conf;

	ssl_certificate /etc/ssl/nginx/domain.com/domain.com.chain.crt;
	ssl_certificate_key /etc/ssl/nginx/domain.com/domain.com.key;

	location / {

		include snippet.d/proxy.conf;

		proxy_pass http://hoppscotch:30011;

	}

	location /admin {

		include snippet.d/proxy.conf;

		proxy_pass http://hoppscotch:30011/admin;

	}

	location /graphql {
		include snippet.d/proxy.conf;

		proxy_pass http://hoppscotch:30011/graphql;
	}

	location /v1/ {
		include snippet.d/proxy.conf;

		proxy_pass http://hoppscotch:30011/v1/;
	}

	include snippet.d/dot_ht_files.conf;
}
Originally created by @Tabinka on GitHub (Mar 21, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4926 ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Current behavior Hi, I think this issue have two sides for my case. I am using docker AIO container behind Nginx proxy server. Well right now it works half to half. When subpath based access is disabled, front-end is working fine through web browser, but /admin is throwing an error with connecting to backend and I cannot acces my instance through desktop app. When subpath based access is enabled, on front-end providers for logging in (in this case email) does not load. Did I miss something or is it a known bug? I saw something similiar in this issue: https://github.com/hoppscotch/hoppscotch/issues/3435 But it does not apply to my case entirely. ### Steps to reproduce 1) Run AIO container in docker compose 2) Run behind Nginx Proxy 3) Access web page This shows when accessing https://hoppscotch.domain.com/admin <img width="1316" alt="Image" src="https://github.com/user-attachments/assets/9757361a-89c6-4f99-8d66-89601818f7c1" /> This shows browser console on both https://hoppscotch.domain.com even though I am able to log in and use it and https://hoppscotch.domain.com/admin (subpath mode is not enabled): <img width="757" alt="Image" src="https://github.com/user-attachments/assets/6c47851a-45c5-40f4-9777-b66ab5f6efd9" /> When subpath is enabled I cannot log in with email provider: <img width="1440" alt="Image" src="https://github.com/user-attachments/assets/c337f47f-b41b-4194-bd2b-3a772dcf234a" /> ### Logs and Screenshots ```shell ``` ### Environment Production ### Hoppscotch Version Self-hosted ### Interceptor Browser - Web App ### Browsers Affected Not browser-specific ### Operating System Other (specify in additional info) ### Additional Information Docker version 23.0.1, build a5ee5b1 nginx version: nginx/1.24.0 Container is running in stack. Snippet of docker-compose.yml: ``` hoppscotch: image: hoppscotch/hoppscotch:2025.2.2 env_file: - env/hoppscotch.env ports: - 30011:80 - 30000:3000 - 31700:3170 - 31000:3100 - 32000:3200 ``` .env file: ``` #-----------------------Backend Config------------------------------# # Prisma Config DATABASE_URL=postgresql://postgres:xxx@database.domain:5432/hoppscotch HOPP_AIO_ALTERNATE_PORT=80 # Auth Tokens Config JWT_SECRET=xxx TOKEN_SALT_COMPLEXITY=10 MAGIC_LINK_TOKEN_VALIDITY=60 REFRESH_TOKEN_VALIDITY=604800000 ACCESS_TOKEN_VALIDITY=86400000 SESSION_SECRET=xxx # Recommended to be true. Set to false if you are using http. # Note: Some auth providers may not support http requests and may stop working when set to false. ALLOW_SECURE_COOKIES=false # Sensitive Data Encryption Key while storing in Database (32 character) DATA_ENCRYPTION_KEY=xxx # Hoppscotch App Domain Config REDIRECT_URL=https://hoppscotch.domain.com WHITELISTED_ORIGINS=https://hoppscotch.domain.com,http://smtprelay.domain.com,https://hoppscotch.domain.com/admin,https://hoppscotch.domain.com/graphql,https://hoppscotch.domain.com/v1,app://hoppscotch.domain.com,http://app.hoppscotch.domain.com VITE_ALLOWED_AUTH_PROVIDERS=EMAIL # Mailer config MAILER_SMTP_ENABLE=true MAILER_USE_CUSTOM_CONFIGS=true MAILER_ADDRESS_FROM=support@domain.com MAILER_SMTP_HOST=smtprelay.domain.com MAILER_SMTP_PORT=25 MAILER_SMTP_SECURE=false MAILER_SMTP_USER=support@domain.com MAILER_SMTP_PASSWORD= MAILER_TLS_REJECT_UNAUTHORIZED=false # Rate Limit Config RATE_LIMIT_TTL=60 RATE_LIMIT_MAX=100 #-----------------------Frontend Config------------------------------# # Base URLs VITE_BASE_URL=https://hoppscotch.domain.com VITE_SHORTCODE_BASE_URL=https://hoppscotch.domain.com VITE_ADMIN_URL=https://hoppscotch.domain.com # Backend URLs VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/graphql VITE_BACKEND_WS_URL=wss://hoppscotch.domain.com/graphql VITE_BACKEND_API_URL=https://hoppscotch.domain.com/v1 # Set to `true` for subpath based access ENABLE_SUBPATH_BASED_ACCESS=true ``` Nginx Proxy config: ``` # # vhost.d/hoppscotch.domain.com.conf # # hoppscotch.domain.com server { listen 80; listen [::]:80; listen 443 ssl http2; listen [::]:443 ssl http2; server_name hoppscotch.domain.com; include snippet.d/redirect_to_https.conf; include snippet.d/log.conf; include snippet.d/ssl.conf; ssl_certificate /etc/ssl/nginx/domain.com/domain.com.chain.crt; ssl_certificate_key /etc/ssl/nginx/domain.com/domain.com.key; location / { include snippet.d/proxy.conf; proxy_pass http://hoppscotch:30011; } location /admin { include snippet.d/proxy.conf; proxy_pass http://hoppscotch:30011/admin; } location /graphql { include snippet.d/proxy.conf; proxy_pass http://hoppscotch:30011/graphql; } location /v1/ { include snippet.d/proxy.conf; proxy_pass http://hoppscotch:30011/v1/; } include snippet.d/dot_ht_files.conf; } ```
kerem 2026-03-16 22:08:01 +03:00
Author
Owner

@Stephen-PP commented on GitHub (Mar 23, 2025):

@Tabinka I don't know if you've resolved this, but I was able to fix this by prepending /backend to all URLs.

For example:

VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/backend/graphql
VITE_BACKEND_WS_URL=wss://hoppscotch.domain.com/backend/graphql
VITE_BACKEND_API_URL=https://hoppscotch.domain.com/backend/v1
<!-- gh-comment-id:2745994401 --> @Stephen-PP commented on GitHub (Mar 23, 2025): @Tabinka I don't know if you've resolved this, but I was able to fix this by prepending /backend to all URLs. For example: ``` VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/backend/graphql VITE_BACKEND_WS_URL=wss://hoppscotch.domain.com/backend/graphql VITE_BACKEND_API_URL=https://hoppscotch.domain.com/backend/v1 ```
Author
Owner

@balub commented on GitHub (Mar 24, 2025):

Hey @Tabinka if ENABLE_SUBPATH_BASED_ACCESS is true then you access the backend using <URL>/backend. Try replacing VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/graphql with VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/backend/graphql and see if you can access the backend.

and try adding the code below to your nginx config.

location /backend {
		include snippet.d/proxy.conf;

		proxy_pass http://hoppscotch:30011/backend;
	}


<!-- gh-comment-id:2749274985 --> @balub commented on GitHub (Mar 24, 2025): Hey @Tabinka if `ENABLE_SUBPATH_BASED_ACCESS` is `true` then you access the backend using `<URL>/backend`. Try replacing `VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/graphql` with `VITE_BACKEND_GQL_URL=https://hoppscotch.domain.com/backend/graphql` and see if you can access the backend. and try adding the code below to your nginx config. ``` location /backend { include snippet.d/proxy.conf; proxy_pass http://hoppscotch:30011/backend; } ```
Author
Owner

@Tabinka commented on GitHub (Mar 25, 2025):

Thank you guys a lot! This worked!

<!-- gh-comment-id:2750852004 --> @Tabinka commented on GitHub (Mar 25, 2025): Thank you guys a lot! This worked!
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#1857
No description provided.