[GH-ISSUE #3733] [bug]: Login model not show email option, and toast Unable to load auth providers #1295

Closed
opened 2026-03-16 19:42:59 +03:00 by kerem · 10 comments
Owner

Originally created by @aliuq on GitHub (Jan 9, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3733

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Login model not show email option, and toast Unable to load auth providers

I found plantform is undefined

image

Steps to reproduce

Hoppscotch version is 2023.12.2

.env

#-----------------------Backend Config------------------------------#
# Prisma Config
DATABASE_URL=postgresql://postgres:xxxxx@hoppscotch-db:5432/hoppscotch

ENABLE_SUBPATH_BASED_ACCESS=true
PUID=1026
PGID=100
LANG=zh_CN.utf8

# # Auth Tokens Config
JWT_SECRET=xxxxxxxxxxxxxxxxxxx
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY=3
REFRESH_TOKEN_VALIDITY=604800000
ACCESS_TOKEN_VALIDITY=86400000
SESSION_SECRET=xxxxxxxxxxxxxxxxxxxxxxxx

WHITELISTED_ORIGINS=/backend,/,/admin
VITE_ALLOWED_AUTH_PROVIDERS=EMAIL

# # Mailer config ---- smtps://user@domain.com:pass@smtp.domain.com
MAILER_SMTP_URL="smtps://no-reply@xxxxxxx.com:xxxxxxxxxxxxxxx@smtp.xxxxxxx.com"
# MAILER_ADDRESS_FROM=no-reply@xxxxxxx.com
MAILER_ADDRESS_FROM='"From xxxx Hoppscotch" <no-reply@xxxxxxx.com>'

# # Rate Limit Config
RATE_LIMIT_TTL=60
RATE_LIMIT_MAX=100

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

# Terms Of Service And Privacy Policy Links (Optional)
VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms
VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy

docker-compose.yaml

version: "3.7"
services:
  hoppscotch:
    image: hoppscotch/hoppscotch:latest
    restart: unless-stopped
    env_file: ./.env
    depends_on:
      hoppscotch-db:
        condition: service_healthy
    ports:
      - 3000:80
  hoppscotch-db:
    image: postgres:15
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: xxxxxxxxx
      POSTGRES_DB: hoppscotch
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    healthcheck:
      test:
        - CMD-SHELL
        - sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'
      interval: 5s
      timeout: 5s
      retries: 10

Environment

Production

Version

Self-hosted

Originally created by @aliuq on GitHub (Jan 9, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3733 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior Login model not show email option, and toast `Unable to load auth providers` I found `plantform` is undefined ![image](https://github.com/hoppscotch/hoppscotch/assets/11707934/86dcb1d1-6fd0-48bb-a276-9659e9812712) ### Steps to reproduce Hoppscotch version is `2023.12.2` `.env` ```env #-----------------------Backend Config------------------------------# # Prisma Config DATABASE_URL=postgresql://postgres:xxxxx@hoppscotch-db:5432/hoppscotch ENABLE_SUBPATH_BASED_ACCESS=true PUID=1026 PGID=100 LANG=zh_CN.utf8 # # Auth Tokens Config JWT_SECRET=xxxxxxxxxxxxxxxxxxx TOKEN_SALT_COMPLEXITY=10 MAGIC_LINK_TOKEN_VALIDITY=3 REFRESH_TOKEN_VALIDITY=604800000 ACCESS_TOKEN_VALIDITY=86400000 SESSION_SECRET=xxxxxxxxxxxxxxxxxxxxxxxx WHITELISTED_ORIGINS=/backend,/,/admin VITE_ALLOWED_AUTH_PROVIDERS=EMAIL # # Mailer config ---- smtps://user@domain.com:pass@smtp.domain.com MAILER_SMTP_URL="smtps://no-reply@xxxxxxx.com:xxxxxxxxxxxxxxx@smtp.xxxxxxx.com" # MAILER_ADDRESS_FROM=no-reply@xxxxxxx.com MAILER_ADDRESS_FROM='"From xxxx Hoppscotch" <no-reply@xxxxxxx.com>' # # Rate Limit Config RATE_LIMIT_TTL=60 RATE_LIMIT_MAX=100 #-----------------------Frontend Config------------------------------# # Terms Of Service And Privacy Policy Links (Optional) VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy ``` `docker-compose.yaml` ```yaml version: "3.7" services: hoppscotch: image: hoppscotch/hoppscotch:latest restart: unless-stopped env_file: ./.env depends_on: hoppscotch-db: condition: service_healthy ports: - 3000:80 hoppscotch-db: image: postgres:15 restart: unless-stopped environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: xxxxxxxxx POSTGRES_DB: hoppscotch volumes: - ./pgdata:/var/lib/postgresql/data healthcheck: test: - CMD-SHELL - sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}' interval: 5s timeout: 5s retries: 10 ``` ### Environment Production ### Version Self-hosted
kerem 2026-03-16 19:42:59 +03:00
Author
Owner

@balub commented on GitHub (Jan 11, 2024):

@aliuq Can you check the logs in the container for any error messages being thrown and share them here.

<!-- gh-comment-id:1886621837 --> @balub commented on GitHub (Jan 11, 2024): @aliuq Can you check the logs in the container for any error messages being thrown and share them here.
Author
Owner

@aliuq commented on GitHub (Jan 11, 2024):

@balub I didn’t see any error type information from the logs.

<!-- gh-comment-id:1888141361 --> @aliuq commented on GitHub (Jan 11, 2024): @balub I didn’t see any error type information from the logs.
Author
Owner

@aliuq commented on GitHub (Jan 16, 2024):

Error is always exist. I guessed is wrong configuration

my docker-compose.yaml file

version: "3.7"
services:
  hoppscotch:
    image: hoppscotch/hoppscotch:2023.12.2
    restart: unless-stopped
    env_file: ./.env
    depends_on:
      hoppscotch-db:
        condition: service_healthy
    ports:
      - 3000:80
  hoppscotch-db:
    image: postgres:15
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: xxxxxxxxxxx
      POSTGRES_DB: hoppscotch
      PGDATA: /pg-data
    volumes:
      - ./pgdata:/pg-data
    healthcheck:
      test:
        - CMD-SHELL
        - sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'
      interval: 5s
      timeout: 5s
      retries: 10

my .env file, e.g. origin is https://hoppscotch.xxx.xxx.xx

#-----------------------Backend Config------------------------------#
# Prisma Config
DATABASE_URL=postgresql://postgres:xxxx@hoppscotch-db:5432/hoppscotch

ENABLE_SUBPATH_BASED_ACCESS=true
PUID=1026
PGID=100
LANG=zh_CN.utf8

# # Auth Tokens Config
JWT_SECRET=xxxxxxxxxxxxxxxxxx
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY=3
REFRESH_TOKEN_VALIDITY="604800000"
ACCESS_TOKEN_VALIDITY="86400000"
SESSION_SECRET=xxxxxxxxxxxxxxxxxxxxx

# Hoppscotch App Domain Config
REDIRECT_URL="http://localhost:3000"
WHITELISTED_ORIGINS="https://hoppscotch.xxx.xxx.xx/backend,https://hoppscotch.xxx.xxx.xx,https://hoppscotch.xxx.xxx.xx/admin"
VITE_ALLOWED_AUTH_PROVIDERS=EMAIL

# Google Auth Config
# GOOGLE_CLIENT_ID="*****"
# GOOGLE_CLIENT_SECRET="*****"
# GOOGLE_CALLBACK_URL=/backend/v1/auth/google/callback
# # GOOGLE_CALLBACK_URL=${BASE_URL}/backend/v1/auth/google/callback
# GOOGLE_SCOPE=email,profile

# Github Auth Config
# GITHUB_CLIENT_ID=*****
# GITHUB_CLIENT_SECRET=****
# GITHUB_CALLBACK_URL=${BASE_URL}/backend/v1/auth/github/callback
# GITHUB_SCOPE=user:email

# Microsoft Auth Config
# MICROSOFT_CLIENT_ID=*****
# MICROSOFT_CLIENT_SECRET=*****
# MICROSOFT_CALLBACK_URL=${BASE_URL}/backend/v1/auth/microsoft/callback
# MICROSOFT_SCOPE=user.read
# MICROSOFT_TENANT=common

# # Mailer config ---- smtps://user@domain.com:pass@smtp.domain.com
MAILER_SMTP_URL="smtps://no-reply@xxxxxxx.com:xxxxxxxxxxxxxx@smtp.xxxxx.xxxx.com"
MAILER_ADDRESS_FROM='"From xxxxxxxx Hoppscotch" <no-reply@xxxxxxx.com>'

# # Rate Limit Config
RATE_LIMIT_TTL=60
RATE_LIMIT_MAX=100


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

# # Base URLs
# VITE_BASE_URL=http://192.168.2.10:3000
VITE_BASE_URL=https://hoppscotch.xxx.xxx.xx
VITE_SHORTCODE_BASE_URL=https://hoppscotch.xxx.xxx.xx
VITE_ADMIN_URL=https://hoppscotch.xxx.xxx.xx/admin

# # # Backend URLs
VITE_BACKEND_GQL_URL=https://hoppscotch.xxx.xxx.xx/backend/graphql
VITE_BACKEND_WS_URL=wss://hoppscotch.xxx.xxx.xx/backend/graphql
VITE_BACKEND_API_URL=https://hoppscotch.xxx.xxx.xx/backend/v1

# Terms Of Service And Privacy Policy Links (Optional)
VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms
VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy

Logs here.

logs.txt

<!-- gh-comment-id:1894251637 --> @aliuq commented on GitHub (Jan 16, 2024): Error is always exist. I guessed is wrong configuration my `docker-compose.yaml` file ```yaml version: "3.7" services: hoppscotch: image: hoppscotch/hoppscotch:2023.12.2 restart: unless-stopped env_file: ./.env depends_on: hoppscotch-db: condition: service_healthy ports: - 3000:80 hoppscotch-db: image: postgres:15 restart: unless-stopped environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: xxxxxxxxxxx POSTGRES_DB: hoppscotch PGDATA: /pg-data volumes: - ./pgdata:/pg-data healthcheck: test: - CMD-SHELL - sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}' interval: 5s timeout: 5s retries: 10 ``` my `.env` file, e.g. origin is `https://hoppscotch.xxx.xxx.xx` ```env #-----------------------Backend Config------------------------------# # Prisma Config DATABASE_URL=postgresql://postgres:xxxx@hoppscotch-db:5432/hoppscotch ENABLE_SUBPATH_BASED_ACCESS=true PUID=1026 PGID=100 LANG=zh_CN.utf8 # # Auth Tokens Config JWT_SECRET=xxxxxxxxxxxxxxxxxx TOKEN_SALT_COMPLEXITY=10 MAGIC_LINK_TOKEN_VALIDITY=3 REFRESH_TOKEN_VALIDITY="604800000" ACCESS_TOKEN_VALIDITY="86400000" SESSION_SECRET=xxxxxxxxxxxxxxxxxxxxx # Hoppscotch App Domain Config REDIRECT_URL="http://localhost:3000" WHITELISTED_ORIGINS="https://hoppscotch.xxx.xxx.xx/backend,https://hoppscotch.xxx.xxx.xx,https://hoppscotch.xxx.xxx.xx/admin" VITE_ALLOWED_AUTH_PROVIDERS=EMAIL # Google Auth Config # GOOGLE_CLIENT_ID="*****" # GOOGLE_CLIENT_SECRET="*****" # GOOGLE_CALLBACK_URL=/backend/v1/auth/google/callback # # GOOGLE_CALLBACK_URL=${BASE_URL}/backend/v1/auth/google/callback # GOOGLE_SCOPE=email,profile # Github Auth Config # GITHUB_CLIENT_ID=***** # GITHUB_CLIENT_SECRET=**** # GITHUB_CALLBACK_URL=${BASE_URL}/backend/v1/auth/github/callback # GITHUB_SCOPE=user:email # Microsoft Auth Config # MICROSOFT_CLIENT_ID=***** # MICROSOFT_CLIENT_SECRET=***** # MICROSOFT_CALLBACK_URL=${BASE_URL}/backend/v1/auth/microsoft/callback # MICROSOFT_SCOPE=user.read # MICROSOFT_TENANT=common # # Mailer config ---- smtps://user@domain.com:pass@smtp.domain.com MAILER_SMTP_URL="smtps://no-reply@xxxxxxx.com:xxxxxxxxxxxxxx@smtp.xxxxx.xxxx.com" MAILER_ADDRESS_FROM='"From xxxxxxxx Hoppscotch" <no-reply@xxxxxxx.com>' # # Rate Limit Config RATE_LIMIT_TTL=60 RATE_LIMIT_MAX=100 #-----------------------Frontend Config------------------------------# # # Base URLs # VITE_BASE_URL=http://192.168.2.10:3000 VITE_BASE_URL=https://hoppscotch.xxx.xxx.xx VITE_SHORTCODE_BASE_URL=https://hoppscotch.xxx.xxx.xx VITE_ADMIN_URL=https://hoppscotch.xxx.xxx.xx/admin # # # Backend URLs VITE_BACKEND_GQL_URL=https://hoppscotch.xxx.xxx.xx/backend/graphql VITE_BACKEND_WS_URL=wss://hoppscotch.xxx.xxx.xx/backend/graphql VITE_BACKEND_API_URL=https://hoppscotch.xxx.xxx.xx/backend/v1 # Terms Of Service And Privacy Policy Links (Optional) VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy ``` Logs here. [logs.txt](https://github.com/hoppscotch/hoppscotch/files/13954086/logs.txt)
Author
Owner

@aliuq commented on GitHub (Jan 16, 2024):

I found this error's reason. when I cleared the cache and reload, globalThis.import_meta_env contains all the environment variables, but when I refreshed the page, globalThis.import_meta_env only contains some environment variables. used proxy by frp

before

{
  "VITE_ADMIN_URL": "https://hoppscotch.xxxxxxxxxxx/admin",
  "VITE_ALLOWED_AUTH_PROVIDERS": "EMAIL",
  "VITE_APP_PRIVACY_POLICY_LINK": "https://docs.hoppscotch.io/support/privacy",
  "VITE_APP_TOS_LINK": "https://docs.hoppscotch.io/support/terms",
  "VITE_BACKEND_API_URL": "https://hoppscotch.xxxxxxxxxxx/backend/v1",
  "VITE_BACKEND_GQL_URL": "https://hoppscotch.xxxxxxxxxxx/backend/graphql",
  "VITE_BACKEND_WS_URL": "wss://hoppscotch.xxxxxxxxxxx/backend/graphql",
  "VITE_BASE_URL": "https://hoppscotch.xxxxxxxxxxx",
  "VITE_SHORTCODE_BASE_URL": "https://hoppscotch.xxxxxxxxxxx"
}

after

{
  "VITE_ALLOWED_AUTH_PROVIDERS": "EMAIL",
  "VITE_APP_PRIVACY_POLICY_LINK": "https://docs.hoppscotch.io/support/privacy",
  "VITE_APP_TOS_LINK": "https://docs.hoppscotch.io/support/terms"
}
<!-- gh-comment-id:1894315871 --> @aliuq commented on GitHub (Jan 16, 2024): I found this error's reason. when I cleared the cache and reload, `globalThis.import_meta_env` contains all the environment variables, but when I refreshed the page, `globalThis.import_meta_env` only contains some environment variables. used proxy by `frp` before ```json { "VITE_ADMIN_URL": "https://hoppscotch.xxxxxxxxxxx/admin", "VITE_ALLOWED_AUTH_PROVIDERS": "EMAIL", "VITE_APP_PRIVACY_POLICY_LINK": "https://docs.hoppscotch.io/support/privacy", "VITE_APP_TOS_LINK": "https://docs.hoppscotch.io/support/terms", "VITE_BACKEND_API_URL": "https://hoppscotch.xxxxxxxxxxx/backend/v1", "VITE_BACKEND_GQL_URL": "https://hoppscotch.xxxxxxxxxxx/backend/graphql", "VITE_BACKEND_WS_URL": "wss://hoppscotch.xxxxxxxxxxx/backend/graphql", "VITE_BASE_URL": "https://hoppscotch.xxxxxxxxxxx", "VITE_SHORTCODE_BASE_URL": "https://hoppscotch.xxxxxxxxxxx" } ``` after ```json { "VITE_ALLOWED_AUTH_PROVIDERS": "EMAIL", "VITE_APP_PRIVACY_POLICY_LINK": "https://docs.hoppscotch.io/support/privacy", "VITE_APP_TOS_LINK": "https://docs.hoppscotch.io/support/terms" } ```
Author
Owner

@raffus commented on GitHub (Mar 26, 2024):

I had a similar problem, is related to the .env variables. Double check your URL's configs and try again.
Also, if you want to use EMAIL login, you need to use SSL or it will not work. I ran SSL using nginx as proxy and it worked.
Good luck.

<!-- gh-comment-id:2021491861 --> @raffus commented on GitHub (Mar 26, 2024): I had a similar problem, is related to the .env variables. Double check your URL's configs and try again. Also, if you want to use EMAIL login, you need to use SSL or it will not work. I ran SSL using nginx as proxy and it worked. Good luck.
Author
Owner

@joeljstephen commented on GitHub (Apr 9, 2024):

@aliuq Does the issue still persist for you in the latest release build?

<!-- gh-comment-id:2045003985 --> @joeljstephen commented on GitHub (Apr 9, 2024): @aliuq Does the issue still persist for you in the latest release build?
Author
Owner

@aliuq commented on GitHub (Apr 11, 2024):

@aliuq Does the issue still persist for you in the latest release build?

Sorry, it's been a while since I've used hoppscotch

<!-- gh-comment-id:2048714004 --> @aliuq commented on GitHub (Apr 11, 2024): > @aliuq Does the issue still persist for you in the latest release build? Sorry, it's been a while since I've used hoppscotch
Author
Owner

@joeljstephen commented on GitHub (Apr 11, 2024):

@aliuq This issue isn't present in the latest builds according to my testing. Hence I will be closing this issue in a few days. If you are still facing this issue, please let me know.

<!-- gh-comment-id:2048886757 --> @joeljstephen commented on GitHub (Apr 11, 2024): @aliuq This issue isn't present in the latest builds according to my testing. Hence I will be closing this issue in a few days. If you are still facing this issue, please let me know.
Author
Owner

@raffus commented on GitHub (Apr 19, 2024):

@aliuq This issue isn't present in the latest builds according to my testing. Hence I will be closing this issue in a few days. If you are still facing this issue, please let me know.

I am trying to implement a similar solution and am facing the same problem.

Could you provide the correct .env to run in docker-compose if there is ssl and VITE_ALLOWED_AUTH_PROVIDERS=EMAIL

or is this a bug?

ps: docker hoppscotch/hoppscotch 2024.3.0

Its not a bug, its related to SSL enforcement.
Try using a reverse proxy with SSL and it should work. Also, use https URLs in your VITE_* URL.
In my case, I also had to add extra routes on NGINX, such as:

server { 
  server_name hopp.myapp.com
  ...

  add_header Access-Control-Allow-Origin '${scheme}://hopp-admin.domain.app' always;
  add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
  add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;

  location / {
      proxy_pass http://127.0.0.1:3000;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection 'upgrade';
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_cache_bypass $http_upgrade;
  }

  location /admin {
      proxy_pass http://127.0.0.1:3100;
      proxy_http_version 1.1;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_cache_bypass $http_upgrade;
  }

  location /graphql {
      proxy_pass http://127.0.0.1:3170;
      proxy_http_version 1.1;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_read_timeout 86400;
      proxy_cache_bypass $http_upgrade;
    }

  location /v1 {
      proxy_pass http://127.0.0.1:3170;
      proxy_http_version 1.1;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_cache_bypass $http_upgrade;
    }
   ... certificate configs
}

And in my .env file:

# Base URLs
VITE_BASE_URL=https://hopp.myapp.com
VITE_SHORTCODE_BASE_URL=https://hopp.myapp.com
VITE_ADMIN_URL=https://hopp-admin.myapp.com

# Backend URLs
VITE_BACKEND_GQL_URL=https://hopp.myapp.com/graphql
VITE_BACKEND_WS_URL=wss://hopp.myapp.com/graphql
VITE_BACKEND_API_URL=https://hopp.myapp.com/v1

That worked for me.

Cheers,
RaffusBR

<!-- gh-comment-id:2066784442 --> @raffus commented on GitHub (Apr 19, 2024): > > @aliuq This issue isn't present in the latest builds according to my testing. Hence I will be closing this issue in a few days. If you are still facing this issue, please let me know. > > I am trying to implement a similar solution and am facing the same problem. > > Could you provide the correct .env to run in docker-compose if there is ssl and VITE_ALLOWED_AUTH_PROVIDERS=EMAIL > > or is this a bug? > > ps: docker hoppscotch/hoppscotch 2024.3.0 Its not a bug, its related to SSL enforcement. Try using a reverse proxy with SSL and it should work. Also, use https URLs in your VITE_* URL. In my case, I also had to add extra routes on NGINX, such as: ``` server { server_name hopp.myapp.com ... add_header Access-Control-Allow-Origin '${scheme}://hopp-admin.domain.app' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_cache_bypass $http_upgrade; } location /admin { proxy_pass http://127.0.0.1:3100; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_cache_bypass $http_upgrade; } location /graphql { proxy_pass http://127.0.0.1:3170; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 86400; proxy_cache_bypass $http_upgrade; } location /v1 { proxy_pass http://127.0.0.1:3170; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_cache_bypass $http_upgrade; } ... certificate configs } ``` And in my .env file: ``` # Base URLs VITE_BASE_URL=https://hopp.myapp.com VITE_SHORTCODE_BASE_URL=https://hopp.myapp.com VITE_ADMIN_URL=https://hopp-admin.myapp.com # Backend URLs VITE_BACKEND_GQL_URL=https://hopp.myapp.com/graphql VITE_BACKEND_WS_URL=wss://hopp.myapp.com/graphql VITE_BACKEND_API_URL=https://hopp.myapp.com/v1 ``` That worked for me. Cheers, RaffusBR
Author
Owner

@aliuq commented on GitHub (May 17, 2024):

@JoelJacobStephen Hello, I just tried it. Although the environment variable is available, it will become localhost.

before

{
  "VITE_ADMIN_URL": "https://hoppscotch.xxxxxxxxxxx/admin",
  "VITE_ALLOWED_AUTH_PROVIDERS": "EMAIL",
  "VITE_APP_PRIVACY_POLICY_LINK": "https://docs.hoppscotch.io/support/privacy",
  "VITE_APP_TOS_LINK": "https://docs.hoppscotch.io/support/terms",
  "VITE_BACKEND_API_URL": "https://hoppscotch.xxxxxxxxxxx/v1",
  "VITE_BACKEND_GQL_URL": "https://hoppscotch.xxxxxxxxxxx/graphql",
  "VITE_BACKEND_WS_URL": "wss://hoppscotch.xxxxxxxxxxx/graphql",
  "VITE_BASE_URL": "https://hoppscotch.xxxxxxxxxxx",
  "VITE_SHORTCODE_BASE_URL": "https://hoppscotch.xxxxxxxxxxx"
}

after

image

<!-- gh-comment-id:2117812373 --> @aliuq commented on GitHub (May 17, 2024): @JoelJacobStephen Hello, I just tried it. Although the environment variable is available, it will become `localhost`. before ```json { "VITE_ADMIN_URL": "https://hoppscotch.xxxxxxxxxxx/admin", "VITE_ALLOWED_AUTH_PROVIDERS": "EMAIL", "VITE_APP_PRIVACY_POLICY_LINK": "https://docs.hoppscotch.io/support/privacy", "VITE_APP_TOS_LINK": "https://docs.hoppscotch.io/support/terms", "VITE_BACKEND_API_URL": "https://hoppscotch.xxxxxxxxxxx/v1", "VITE_BACKEND_GQL_URL": "https://hoppscotch.xxxxxxxxxxx/graphql", "VITE_BACKEND_WS_URL": "wss://hoppscotch.xxxxxxxxxxx/graphql", "VITE_BASE_URL": "https://hoppscotch.xxxxxxxxxxx", "VITE_SHORTCODE_BASE_URL": "https://hoppscotch.xxxxxxxxxxx" } ``` after ![image](https://github.com/hoppscotch/hoppscotch/assets/11707934/71dddc58-b5f5-453c-85d3-f0e68c005db6)
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#1295
No description provided.