N
Novu15mo ago
Rifki Salim

Self Hosted instance tries to connect to localhost instead of custom URL

Hi Team. I was able to successfully setup Novu using docker and the containers managed to start up with no issues. I have set up the env variables in the .env file successfully. However, when I try to connect to my self hosted instance and sign up, I get "Network Error" in the UI. Upon checking the console, I see that the POST request related to registering the user is being sent to http://localhost:3000/v1/auth/register instead of the custom URL which would obviously fail
xhr.js:247 POST http://localhost:3000/v1/auth/register net::ERR_CONNECTION_REFUSED
xhr.js:247 POST http://localhost:3000/v1/auth/register net::ERR_CONNECTION_REFUSED
I checked similar threads and tried to use ghcr.io/joeyeamigh/novu/web:nv-1803 as the web container, but I get the same issue. Additionally, I am using NGINX as a reverse proxy and I have set the context paths accordingly
11 Replies
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
Rifki Salim
Rifki Salim15mo ago
thanks for the info, I will try that Now it seems to be pointing to the right domain, but wrong port. I have an nginx host configured as api.novu.example.com which proxies to localhost:3000 (same server as novu). env is set as follows
# Secrets
# YOU MUST CHANGE THESE BEFORE GOING INTO PRODUCTION
JWT_SECRET=secret
STORE_ENCRYPTION_KEY="secretkey"

# General
NODE_ENV=prod
MONGO_URL=mongodb://mongodb:27017/novu-db
REDIS_HOST=redis
REDIS_CACHE_SERVICE_HOST=

# AWS
S3_LOCAL_STACK=http://localhost:4566
S3_BUCKET_NAME=novu-local
S3_REGION=us-east-1
AWS_ACCESS_KEY_ID=test
AWS_SECRET_ACCESS_KEY=test

# Ports
API_PORT=3000
REDIS_PORT=6379
REDIS_CACHE_SERVICE_PORT=6379
WS_PORT=3002

# Root URL
REACT_APP_WS_URL=http://ws.novu.example.com
# Uncomment this one when deploying Novu in the local environment
# as Web app local Dockerfile will have to load this to be used.
# Deployment version doesn't need as we inject it with API_ROOT_URL value.
# REACT_APP_API_URL=http://localhost:3000
API_ROOT_URL=http://api.novu.example.com
DISABLE_USER_REGISTRATION=false
FRONT_BASE_URL=http://novu.example.com
WIDGET_EMBED_PATH=http://widget.novu.example.com/embed.umd.min.js
WIDGET_URL=http://widget.novu.example.com

# Context Paths
# Only needed for setups with reverse-proxies
GLOBAL_CONTEXT_PATH=
WEB_CONTEXT_PATH=
API_CONTEXT_PATH=
WS_CONTEXT_PATH=
WIDGET_CONTEXT_PATH=

# Analytics
SENTRY_DSN=
NEW_RELIC_APP_NAME=
NEW_RELIC_LICENSE_KEY=
# Secrets
# YOU MUST CHANGE THESE BEFORE GOING INTO PRODUCTION
JWT_SECRET=secret
STORE_ENCRYPTION_KEY="secretkey"

# General
NODE_ENV=prod
MONGO_URL=mongodb://mongodb:27017/novu-db
REDIS_HOST=redis
REDIS_CACHE_SERVICE_HOST=

# AWS
S3_LOCAL_STACK=http://localhost:4566
S3_BUCKET_NAME=novu-local
S3_REGION=us-east-1
AWS_ACCESS_KEY_ID=test
AWS_SECRET_ACCESS_KEY=test

# Ports
API_PORT=3000
REDIS_PORT=6379
REDIS_CACHE_SERVICE_PORT=6379
WS_PORT=3002

# Root URL
REACT_APP_WS_URL=http://ws.novu.example.com
# Uncomment this one when deploying Novu in the local environment
# as Web app local Dockerfile will have to load this to be used.
# Deployment version doesn't need as we inject it with API_ROOT_URL value.
# REACT_APP_API_URL=http://localhost:3000
API_ROOT_URL=http://api.novu.example.com
DISABLE_USER_REGISTRATION=false
FRONT_BASE_URL=http://novu.example.com
WIDGET_EMBED_PATH=http://widget.novu.example.com/embed.umd.min.js
WIDGET_URL=http://widget.novu.example.com

# Context Paths
# Only needed for setups with reverse-proxies
GLOBAL_CONTEXT_PATH=
WEB_CONTEXT_PATH=
API_CONTEXT_PATH=
WS_CONTEXT_PATH=
WIDGET_CONTEXT_PATH=

# Analytics
SENTRY_DSN=
NEW_RELIC_APP_NAME=
NEW_RELIC_LICENSE_KEY=
The register route seems to be sending the post request to http://novu.example.com:3000/v1/auth/register which results in POST http://novu.nfsbattles.rifkisalim.com:3000/v1/auth/register net::ERR_NAME_NOT_RESOLVED as the 3000 port is not opened since I am using a nginx reverse proxy
Novu_Bot
Novu_Bot15mo ago
@rifkisalim.dev, you just advanced to level 1!
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
Rifki Salim
Rifki Salim15mo ago
Update: the issue was fixed after "ghcr.io/joeyeamigh/novu/web:nv-1803" as the image for novu web. Deleting all containers and volumes and recreating after setting the new env variable and clearing browser cache seemed to solve the issue
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
sumitsaurabh927
sumitsaurabh92715mo ago
Thanks for posting this @rifkisalim.dev @bhavikchavda @mishrabhushan @fetchman Can you please look into this @zacclifton ? Anyone from @Engineering please have a look here!
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
sumitsaurabh927
sumitsaurabh92715mo ago
Glad to see this!
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
Novu_Bot
Novu_Bot15mo ago
@mishrabhushan, you just advanced to level 1!