mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #4935] Issue with Admin Panel and GitHub Auth When Using Domain Instead of Public IP #1863
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1863
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pra-cloud on GitHub (Mar 25, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4935
Is there an existing issue for this?
Current behavior
I am experiencing an issue where my admin panel is not loading (white screen), and GitHub authentication returns a 404 error when using a domain instead of the public IP in my .env file. However, when I use the public IP, both the OAuth authentication and the admin panel work fine. The issue arises when using NGINX, SSL, and the domain.
Expected Behavior
The admin panel should load properly.
GitHub OAuth authentication should work correctly.
Actual Behavior
The admin panel displays a white screen.
GitHub authentication fails with a 404 error.### ****
Steps to reproduce
Configure the .env file with the domain (hoppscotch.hyperzod.dev).
Deploy the application using NGINX and SSL.
Attempt to access the admin panel (https://hoppscotch.hyperzod.dev/admin).
Attempt to authenticate using GitHub OAuth.
Observe that the admin panel does not load and GitHub authentication fails with a 404 error.
Logs and Screenshots
Environment
Production
Hoppscotch Version
Self-hosted
Interceptor
Browser - Web App
Browsers Affected
Chrome
Operating System
Linux
Additional Information
Environment Variables
Not Working Configuration (Using Domain):
DATABASE_URL=postgresql://postgres:pass@172.17.0.1:5432/postgres
HOPP_AIO_ALTERNATE_PORT=80
JWT_SECRET=gAIQE8XVwJUt1tuBfsM3fg0H5LK7um9UWqxJ4wd
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY=3
REFRESH_TOKEN_VALIDITY=604800000
ACCESS_TOKEN_VALIDITY=86400000
SESSION_SECRET=gAIQE8XVwJEERFEREg
ALLOW_SECURE_COOKIES=true
DATA_ENCRYPTION_KEY=7dIZmrLxxwMJUP/unPydEX3rud84LLd0
REDIRECT_URL=https://hoppscotch.hyperzod.dev/
WHITELISTED_ORIGINS=https://hoppscotch.hyperzod.dev/backend,https://hoppscotch.hyperzod.dev/,https://hoppscotch.hyperzod.dev/admin
VITE_ALLOWED_AUTH_PROVIDERS=GITHUB
GITHUB_CLIENT_ID=Ov23liEHoRAv
GITHUB_CLIENT_SECRET=b4e15b453b503301686298f488f
GITHUB_CALLBACK_URL=https://hoppscotch.hyperzod.dev/backend/v1/auth/github/callback
GITHUB_SCOPE=user:email
MAILER_SMTP_ENABLE=true
MAILER_USE_CUSTOM_CONFIGS=false
MAILER_ADDRESS_FROM=pm68199@gmail.com
MAILER_SMTP_URL=smtp://172.17.0.1:1025
VITE_BASE_URL=https://hoppscotch.hyperzod.dev
VITE_ADMIN_URL=https://hoppscotch.hyperzod.dev/admin
VITE_BACKEND_GQL_URL=https://hoppscotch.hyperzod.dev/backend/graphql
VITE_BACKEND_WS_URL=wss://hoppscotch.hyperzod.dev/backend/graphql
VITE_BACKEND_API_URL=https://hoppscotch.hyperzod.dev/backend/v1
ENABLE_SUBPATH_BASED_ACCESS=false
Working Configuration (Using Public IP):
DATABASE_URL=postgresql://postgres:testpass@172.17.0.1:5432/postgres
HOPP_AIO_ALTERNATE_PORT=80
JWT_SECRET=gAIQE8XVwJUt1tuBfsM3fg0H5LK7um9UWqxJ4wd
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY=3
REFRESH_TOKEN_VALIDITY=604800000
ACCESS_TOKEN_VALIDITY=86400000
SESSION_SECRET=gAIQE8XVwJEERFEREg
ALLOW_SECURE_COOKIES=false
DATA_ENCRYPTION_KEY=7dIZmrLxxwMJUP/unPydEX3rud84LLd0
REDIRECT_URL=http://4.188.239.153:3000
WHITELISTED_ORIGINS=http://4.188.239.153:3170,http://4.188.239.153:3000,http://4.188.239.153:3100
VITE_ALLOWED_AUTH_PROVIDERS=GITHUB
GITHUB_CLIENT_ID=Ov23li1hmH2v4MgR
GITHUB_CLIENT_SECRET=c3f7fa3f58965186b66ecd3637fb4173e4
GITHUB_CALLBACK_URL=http://4.188.239.153:3170/v1/auth/github/callback
GITHUB_SCOPE=user:email
MAILER_SMTP_ENABLE=true
MAILER_USE_CUSTOM_CONFIGS=false
MAILER_ADDRESS_FROM=pm68199@gmail.com
MAILER_SMTP_URL=smtp://172.17.0.1:1025
VITE_BASE_URL=http://4.188.239.153:3000
VITE_ADMIN_URL=http://4.188.239.153:3100
VITE_BACKEND_GQL_URL=http://4.188.239.153:3170/graphql
VITE_BACKEND_WS_URL=wss://4.188.239.153:3170/graphql
VITE_BACKEND_API_URL=http://4.188.239.153:3170/v1
ENABLE_SUBPATH_BASED_ACCESS=false
Additional Context
I am using NGINX as a reverse proxy with SSL enabled.
The issue seems to be related to how requests are handled when using a domain with SSL.
NGINX CONF
server {
listen 80;
server_name hoppscotch.hyperzod.dev;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name hoppscotch.hyperzod.dev;
}
Nginx Error Logs :-
2025/03/25 10:12:41 [error] 73543#73543: *124 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 49.36.212.127, server: hoppscotch.hyperzod.dev, request: "GET /admin/ HTTP/1.1", upstream: "http://127.0.0.1:3100/admin/", host: "hoppscotch.hyperzod.dev"
2025/03/25 10:12:41 [error] 73543#73543: *124 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 49.36.212.127, server: hoppscotch.hyperzod.dev, request: "GET /sw.js HTTP/1.1", upstream: "http://127.0.0.1:3000/sw.js", host: "hoppscotch.hyperzod.dev", referrer: "https://hoppscotch.hyperzod.dev/sw.js"
2025/03/25 10:12:42 [error] 73543#73543: *124 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 49.36.212.127, server: hoppscotch.hyperzod.dev, request: "GET /sw.js HTTP/1.1", upstream: "http://127.0.0.1:3000/sw.js", host: "hoppscotch.hyperzod.dev", referrer: "https://hoppscotch.hyperzod.dev/sw.js"
2025/03/25 10:12:43 [error] 73543#73543: *124 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 49.36.212.127, server: hoppscotch.hyperzod.dev, request: "GET /admin/ HTTP/1.1", upstream: "http://127.0.0.1:3100/admin/", host: "hoppscotch.hyperzod.dev"
2025/03/25 10:12:44 [error] 73543#73543: *124 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 49.36.212.127, server: hoppscotch.hyperzod.dev, request: "GET /sw.js HTTP/1.1", upstream: "http://127.0.0.1:3000/sw.js", host: "hoppscotch.hyperzod.dev", referrer: "https://hoppscotch.hyperzod.dev/sw.js"
2025/03/25 10:12:44 [error] 73543#73543: *124 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 49.36.212.127, server: hoppscotch.hyperzod.dev, request: "POST /backend/graphql HTTP/1.1", upstream: "http://127.0.0.1:3170/backend/graphql", host: "hoppscotch.hyperzod.dev", referrer: "https://hoppscotch.hyperzod.dev/"
2025/03/25 10:12:47 [error] 73543#73543: *124 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 49.36.212.127, server: hoppscotch.hyperzod.dev, request: "GET /sw.js HTTP/1.1", upstream: "http://127.0.0.1:3000/sw.js", host: "hoppscotch.hyperzod.dev", referrer: "https://hoppscotch.hyperzod.dev/sw.js"
@pra-cloud commented on GitHub (Mar 25, 2025):
@strepon please help
@mirarifhasan commented on GitHub (Mar 25, 2025):
@pra-cloud
Could you try setting
ENABLE_SUBPATH_BASED_ACCESS=true, then stop the backend container and start it again?.@pra-cloud commented on GitHub (Mar 26, 2025):
@mirarifhasan
I am using an AIO container,
docker run -p 3000:3000 -p 3100:3100 -p 3170:3170 --env-file .env --restart unless-stopped hoppscotch/hoppscotch:latest
@gourav3255 commented on GitHub (Apr 8, 2025):
I am also facing the issue after Google Oauth am not able to login to admin portal again on the same page to asking for sign-in.