hetzneronline / community-content

Hetzner Online Community Project
https://community.hetzner.com
MIT License
310 stars 363 forks source link

A simple installation guide for Nginx Proxy Manager #989

Open Tom-246 opened 1 week ago

Tom-246 commented 1 week ago

Problem

As I would like to connect to local docker containers also I used the option: network_mode: 'host'

Doing this I cannot login. Error is 'bad gateway'.

Not using this option login is possible.

Any hints?

Suggested Fix

Don't know...

svenja11 commented 4 days ago

Hello @Tom-246, I just tested the tutorial on Ubuntu 24.04 with network_mode: 'host' and it worked for me. I installed the Nginx Proxy Manager and added a new proxy host that points proxy.example.com at http://127.0.0.1:81. When I access proxy.example.com, I can login with my admin credentials. Next, I started a WordPress Docker container on the same server as the Nginx Proxy Manager:

holu@example-server:~$ docker ps
CONTAINER ID   IMAGE                              PORTS                                     NAMES
52485248ec48   wordpress                          0.0.0.0:8080->80/tcp, [::]:8080->80/tcp   thirsty_greider
868286820b82   jc21/nginx-proxy-manager:latest                                              npm-app-1

I went back to proxy.example.com and created a second proxy host. The second proxy host points wordpress.example.com to http://127.0.0.1:8080. When I access wordpress.example.com, it takes me to the WordPress GUI, as expected.

Where exactly can you not login?

Tom-246 commented 2 days ago

Hi @svenja11!

I cannot login to the Nginx Proxy Manager - it's just the first login after getting the docker-container up and running - I haven't configured anything within the Proxy Manager.

As I'm 'at home' I do use http://server-ip:81. If I add the option network_mode: 'host' I do get this bad gateway error. Login is only possible without the option.

Kind regards,