🐛 Bug Report: Unraid - Failed to get application configuration: connect ECONNREFUSED 127.0.0.1:8080 #394

Closed
opened 2025-10-08 00:06:43 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @ryphez on GitHub.

Reproduction steps

I'm running into the same issue leveraging Unraid's template similar to https://github.com/stonith404/pocket-id/issues/10

What ended up being the solution here when overriding the PUBLIC_APP_URL and Ports? My unraid is only running http, but plan for everything to go thru Cloudflare to get HTTPS on my domain pointing at "pocket.mydomain.com". I'm just wanting to start up Pocket Id to get to things being setup. I'm using SWAG too if that matters, but I haven't setup any reverse proxying yet

docker run -d --name='Pocket-ID' --net='andromedanet' --pids-limit 2048 -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Hostname" -e HOST_CONTAINERNAME="Pocket-ID" -e 'PUBLIC_APP_URL'='http://192.168.1.50:3008' -e 'DB_PATH'='data/pocket-id.db' -e 'UPLOAD_PATH'='data/uploads' -e 'PORT'='3008' -e 'BACKEND_PORT'='8089' -e 'PUID'='099' -e 'PGID'='100' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:80]/' -l net.unraid.docker.icon='https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/pocket-id-icon.png' -p '3008:80/tcp'

Expected behavior

I should see some setup instructions on Pocket Id launch page

Actual Behavior

Listening on 0.0.0.0:3008 Failed to get application configuration: connect ECONNREFUSED 127.0.0.1:8080

Originally created by @ryphez on GitHub. ### Reproduction steps I'm running into the same issue leveraging Unraid's template similar to https://github.com/stonith404/pocket-id/issues/10 What ended up being the solution here when overriding the PUBLIC_APP_URL and Ports? My unraid is only running http, but plan for everything to go thru Cloudflare to get HTTPS on my domain pointing at "pocket.mydomain.com". I'm just wanting to start up Pocket Id to get to things being setup. I'm using SWAG too if that matters, but I haven't setup any reverse proxying yet `docker run -d --name='Pocket-ID' --net='andromedanet' --pids-limit 2048 -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Hostname" -e HOST_CONTAINERNAME="Pocket-ID" -e 'PUBLIC_APP_URL'='http://192.168.1.50:3008' -e 'DB_PATH'='data/pocket-id.db' -e 'UPLOAD_PATH'='data/uploads' -e 'PORT'='3008' -e 'BACKEND_PORT'='8089' -e 'PUID'='099' -e 'PGID'='100' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:80]/' -l net.unraid.docker.icon='https://raw.githubusercontent.com/nwithan8/unraid_templates/master/images/pocket-id-icon.png' -p '3008:80/tcp'` ### Expected behavior I should see some setup instructions on Pocket Id launch page ### Actual Behavior `Listening on 0.0.0.0:3008 Failed to get application configuration: connect ECONNREFUSED 127.0.0.1:8080`
OVERLORD added the bug label 2025-10-08 00:06:43 +03:00
Author
Owner

@stonith404 commented on GitHub:

Is there a reason why you changed the backend and frontend port? I would just keep it on default.

Additionally, you need a reverse proxy because you won't be able to add a passkey if you're not using SSL.

@stonith404 commented on GitHub: Is there a reason why you changed the backend and frontend port? I would just keep it on default. Additionally, you need a reverse proxy because you won't be able to add a passkey if you're not using SSL.
Author
Owner

@stonith404 commented on GitHub:

Great, thanks for sharing your solution.

@stonith404 commented on GitHub: Great, thanks for sharing your solution.
Author
Owner

@ceedubs commented on GitHub:

Thanks @ryphez I encountered a similar issue and your comment and example nginx config were really helpful!

I also think that I figured out the issue that you were encountering when using a port other than 8080 for the backend. In addition to setting BACKEND_PORT to 8089 you need to set INTERNAL_BACKEND_URL to http://localhost:8089, because it defaults to http://localhost:8080. Once I made that change everything worked fine with non-standard ports.

@ceedubs commented on GitHub: Thanks @ryphez I encountered a similar issue and your comment and example nginx config were really helpful! I also think that I figured out the issue that you were encountering when using a port other than 8080 for the backend. In addition to setting `BACKEND_PORT` to `8089` you need to set `INTERNAL_BACKEND_URL` to `http://localhost:8089`, because it defaults to `http://localhost:8080`. Once I made that change everything worked fine with non-standard ports.
Author
Owner

@ryphez commented on GitHub:

I have other apps on both. I was able to swap my backend port back to 8080 which seems to be fine with the frontend port being shifted.

As for HTTPS, I take it the setup needs to go thru the reverse proxy rather than accessing it via the unsecured address. Is that correct?

I setup my SWAG endpoint and it doesn't like the added NGINX parameters listed on the main page

nginx: [emerg] "proxy_busy_buffers_size" must be less than the size of all "proxy_buffers" minus one buffer in /config/nginx/nginx.conf:82
nginx: configuration file /etc/nginx/nginx.conf test failed
Changes to nginx config detected but the changes are not valid, skipping nginx reload. Please fix your config.
/config/nginx/proxy-confs/ MODIFY pocketid.subdomain.conf
Changes to nginx config detected but the changes are not valid, skipping nginx reload. Please fix your config.
/config/nginx/proxy-confs/ MODIFY pocketid.subdomain.conf
Changes to nginx config detected but the changes are not valid, skipping nginx reload. Please fix your config.

SWAG config - note i've changed port from 3008 -> 3002.

## Version 2024/07/16
# make sure that your Pocket-ID container is named Pocket-ID
# make sure that your dns has a cname set for pocket

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name pocket.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    # enable for Authentik (requires authentik-location.conf in the location block)
    #include /config/nginx/authentik-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        # enable for Authentik (requires authentik-server.conf in the server block)
        #include /config/nginx/authentik-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app Pocket-ID;
        set $upstream_port 3002;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
        proxy_set_header X-Scheme https;

    }
}

Updated proxy.conf with the parameters for NGINX

    proxy_busy_buffers_size   512k;
    proxy_buffers   4 512k;
    proxy_buffer_size   256k;

This gets me working! Wanted to post more of these details for others who may run into this. Appreciate the help!

@ryphez commented on GitHub: I have other apps on both. I was able to swap my backend port back to 8080 which seems to be fine with the frontend port being shifted. As for HTTPS, I take it the setup needs to go thru the reverse proxy rather than accessing it via the unsecured address. Is that correct? I setup my SWAG endpoint and it doesn't like the added NGINX parameters listed on the main page ``` nginx: [emerg] "proxy_busy_buffers_size" must be less than the size of all "proxy_buffers" minus one buffer in /config/nginx/nginx.conf:82 nginx: configuration file /etc/nginx/nginx.conf test failed Changes to nginx config detected but the changes are not valid, skipping nginx reload. Please fix your config. /config/nginx/proxy-confs/ MODIFY pocketid.subdomain.conf Changes to nginx config detected but the changes are not valid, skipping nginx reload. Please fix your config. /config/nginx/proxy-confs/ MODIFY pocketid.subdomain.conf Changes to nginx config detected but the changes are not valid, skipping nginx reload. Please fix your config. ``` SWAG config - note i've changed port from 3008 -> 3002. ``` ## Version 2024/07/16 # make sure that your Pocket-ID container is named Pocket-ID # make sure that your dns has a cname set for pocket server { listen 443 ssl; listen [::]:443 ssl; server_name pocket.*; include /config/nginx/ssl.conf; client_max_body_size 0; # enable for ldap auth (requires ldap-location.conf in the location block) #include /config/nginx/ldap-server.conf; # enable for Authelia (requires authelia-location.conf in the location block) #include /config/nginx/authelia-server.conf; # enable for Authentik (requires authentik-location.conf in the location block) #include /config/nginx/authentik-server.conf; location / { # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; # enable for ldap auth (requires ldap-server.conf in the server block) #include /config/nginx/ldap-location.conf; # enable for Authelia (requires authelia-server.conf in the server block) #include /config/nginx/authelia-location.conf; # enable for Authentik (requires authentik-server.conf in the server block) #include /config/nginx/authentik-location.conf; include /config/nginx/proxy.conf; include /config/nginx/resolver.conf; set $upstream_app Pocket-ID; set $upstream_port 3002; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; proxy_set_header X-Scheme https; } } ``` Updated proxy.conf with the parameters for NGINX ``` proxy_busy_buffers_size 512k; proxy_buffers 4 512k; proxy_buffer_size 256k; ``` This gets me working! Wanted to post more of these details for others who may run into this. Appreciate the help!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#394