NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
20.82k stars 2.41k forks source link

Bad Gateway on Nginx proxy manager login screen #3052

Open die-lolol opened 12 months ago

die-lolol commented 12 months ago

I've just setup nginx proxy manager but whenever I go to the login and input the default credentials it always says bad gateway could anyone tell me why this is?

SignFinder commented 12 months ago

I am not sure that you provided enough of information. Where is info about OS, way to install npm, description how you made login to npm - ip. name, what port etc.

adamnock commented 11 months ago

Just going to add to this as I had the same problem, and debugged it for a bit till it just, vanished

Eventually understood that the frontend was attempting to pass /api/token to 127.0.01:3000 inside the container, and this was the backend. lsof -i showed only 80, 81 and 443 were listening

force ran node /app/index.js Backend came up and could login

Closed container, rebooted it. Still working

Deleted container, image and volumes, including DB. Reinstalled clean Same problem Exec in, force start backend, reboot. Works So something is stalling the backend start to the point it wont run, but forcing an execute is kicking it in

Attached docker logs output from after a forced run. Might help. Happy to assist further

docker.logs.txt

davhae commented 11 months ago

Have you looked at the container logs of your database?

Probably a known error, when having the database volume (of mysql container) as a subdirectory of the NPM volume.

andycandy-de commented 11 months ago

Please check your docker-compose.yml. Maybe you mount the mysql folder to the npm container, which also gives me a bad gateway response. https://github.com/NginxProxyManager/nginx-proxy-manager/pull/3078

The volume of the db container should be defined as follow:

    volumes:
      - ./mysql:/var/lib/mysql
nmatton commented 10 months ago

I have this issues that pops up from updating... all was fine before :(

    volumes:
      - ./mysql:/var/lib/mysql

on my side, I used

    volumes:
      - ./data/mysql:/var/lib/mysql

but I guess it makes no difference

nmatton commented 10 months ago

when checking logs, I have the following:

[8/22/2023] [10:00:50 AM] [Global   ] › ✖  error     create table `migrations` (`id` int unsigned not null auto_increment primary key, `name` varchar(255), `bae `npm`.`migrations` (errno: 13 "Permission denied")

I (quick)fixed it using mariadb;latest image as described in #2990

b141r commented 10 months ago

same bad gateway issue. add this container to "bridge" network solve my problem..

andycandy-de commented 9 months ago

but I guess it makes no difference

@nmatton it makes an difference. With your definition ./data/mysql:/var/lib/mysql the NPM container can access the DB data files. Because the NPM container mounts the data folder ./data:/data. And that is the problem. Because of that you got the "Permission denied" error.

So moving your DB folder and using the correct mount for your DB container will solve your issue! ./mysql:/var/lib/mysql

ProudActor commented 7 months ago

I want to know how to solve my problem?thanks. the log show:select * from migrations_lock - ER_OPEN_AS_READONLY: Table './npm/migrations_lock.MAI' is read only

github-actions[bot] commented 1 month ago

Issue is now considered stale. If you want to keep it open, please comment :+1: