Nginx Proxy Manager - How-To Installation and Configuration
HTML-код
- Опубликовано: 3 июл 2024
- In this Nginx Proxy Manager How-To, I'll show you how to install and configure Nginx Proxy Manager in Docker. #Docker #NginxProxyManager #HomeLab
DOCS: github.com/christianlempa/vid...
Follow me:
TWITTER: / christianlempa
INSTAGRAM: / christianlempa
DISCORD: / discord
GITHUB: github.com/christianlempa
PATREON: / christianlempa
MY EQUIPMENT: kit.co/christianlempa
Timestamps:
00:00 - Introduction
01:52 - Deploy NGINX proxy manager on Linux
04:18 - Log in to the web UI
05:40 - Set up a public DNS record
06:40 - Obtain an SSL cert
07:21 - Expose a simple web application with nextcloud example
09:27 - Add a new proxy host
----
All links with "*" are affiliate links.
Watch Next ➡️ Manage Docker Containers: ruclips.net/video/ljDI5jykjE8/видео.html
Thanks for the video. I have issue with database like below Error. can you help me out.
Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
@@kavithak1138 I have the same issue. It involves editing in the md config file but I don’t know how to do it inside a docker container which was in a compose stack.
À
Hi Christian would this be the same process if using podman with fedora?
@@markstanchin1692 use portainer and attach a console/terminal to the container. edit: or just dont use -d at the end of the docker-compose command
Thanks man! Was trying to figure this out over the last few days and the little bit of extra details you shared on this video helped a lot. Particularly when you pushed to explain how dependant it was, for the same networks to be used.
You’re welcome ! Glad it helped :)
Each time when I try to found something in another tuto, yours gave me the right solution always. I’ll stay here forever
Thank you so much 🤗
2 years down the line and this is still an invaluable resource.
You are just amazing man. That's the most helpful video I watched on youtube this month. Thanks a lot!
Thank you so much for this video, as well as your others for Docker, Docker-Compose, etc., as they have truly helped me out. I am a novice in Linux, so showing all the steps, as well as explaining them, was fantastic. Cheers!
Thank you! I'm glad it helps you :)
@@christianlempa one question, do you know how I can set my specific docker-compose item to restart on reboot? I noticed when rebooting that system that NPM was not available again until I ran the up -d command. Thank you!
Just start working on managing multiple docker containers, your content is really helpful. Thanks
That's awesome 😎👍 thanks for sharing
Appreciate the video Christian, thanks for putting this together!
Fantastic work Christian, I have just started diving into docker. Thank you for the content, I have learnt so much from it!
Thank you so much! Glad you enjoy the content :)
Awesome content, I was looking for a confirmation of the docker network rule and you explained really clear.
Glad it was helpful!
Great video. I keep coming here every while to review
Amazing tutorial. Thank you, Chris 😊
Thank you for the great tutorial! Very helpful, and quite entertaining!
Glad you enjoyed it!
Works great man ! Thanks for the lesson.
I've just finished building the mail server after 2-3 days of headaches, with iredmail and manage that while hosting a website.
Can't believe I found it after :P
thanks!
keep the good work.
Thanks! I will do 😁
just found your channel. really solid videos. love the energy!
Thank you 😁
Great content! Thanks for aweome tutorials and solutions that just work great.
Thank you buddy 😊
This is a great video! Now I need to get this setup with my home server!
thx :)
You gained a subscriber there is tons of content here to be consumed in just one video! You sir, are amazing!
Thank you so much! 🥰
Why I'm I only seeing your channel now🤪, thank you for your great content.
Nice tutorial I have figure it out how to make it work with docker compose and it was hella fun.
more brilliant content! thank you!
thanks! :)
Thank you very much, bonus was this easy LET'S cert implementation I was looking for, great explanation for layman like me…!
You save my life ! I was stuck for 1 week before watching your video. I had a port configuration problem (port 8080, 8181, 4443 instead of 80, 81, 443) because of the image configuration page on dockerHub
Glad I could help mate 😉
Thank you Christian for providing a fast way to understand what, how and why. Please could you soon explain how containers, stack and networks fit together.
Great suggestion bro! I will make a future video about docker Networks, may take some weeks though
@@christianlempa ich bekomme bei 4:34 die Meldung bad gateway, nach dem ich die Zugangsdaten eingebe :(
thank you Chis, i manage to make it work!
thanks didnt know this existed. Great for sharing my webapps with friends.
Great info! Liked and subscribed!
Thank you! :)
you saved my life! Thank you!!!
You're welcome!
Man, thank you so much. You have saved me!
Thank you! Glad to hear that :)
Thank you, usefull content!
Thanks for the great video !
Glad you liked it!
Nice one mate!
Thank you so much, great content. ✌
Thanks ❤😍
It does not do everything but what it does it does very very well. The certificate auto-renewal and the ability to perform almost all reverse proxy functions on the GUI is just too good. However, apart from the initial setup, the official documentation is almost non-existent.
Very good solution for multiple subdomains.
Soooo helpful.
thank you a lot you saved me lot of time
Glad it was helpful ;)
Nice explanation
Thanks!
you are awesome! thanks!
Glad it helped!
You are a gem.
Thx :D
You made my day :)
Thx :D
Thanks great video I've been looking for a tutorial like this for a long time.
Well this looks great. I have been using an old version of ajenti with an nginx plugin to handle proxies but it's so outdated. Gonna take a look at this
amazing video
Thanks!
GG...perfect alternative to kemp
Very helpful especially for joking the np-m network and calling via name not ip addr
Sounds great. If only it actually worked for SSL certificate grabbing for digital ocean. I ended up installing nginx on it's own and doing everything on the command line.
Keep coding and rocking in the free world, outstanding work mate! Have a good one and cheers!
Thank you bro! Cheers
so after docker compose up -d i can reach the webui and when i try to login with the default creds i get bad gateway.. from what i've seen online its supposed to also have a config.json file which i dont, anyone with some clear instuctions on that? i have seen no such step in this video so im a bit confused
Thanks for the video. I learned something and found it easy to follow and set up reverse proxies. I don't quite understand why you use docker, though. I'm running mine in a dedicated lxc.
awesome
It would be really nice if NPM was able to scan existing nginx entries on install and import them into the manager. I set up my nginx the manual way a long time ago and I really can't be bothered to now reset them all up through the manager. Shame though as it would be nice to have a UI to manage them all
You can always use something like terraform/pulumi. This will be one time effort but after that you can migrate to other tools if you want as you will have ip:host mappings in one place.
@@malborboss I ended up switching to Traefik, lol.
Great video! Def need to slow down though! .75x speed is perfect
Thanks bro
good videos buddy
Thanks 👍
Nice :D
Good. Waiting for wildcard certificates in Nginx. Thanks
Thanks man :)
Thank you so much! I got this working perfectly after having a bit of trouble with Traefik and HAProxy. I do have one question, how do I use this with my host network? For instance, I would like to use this for a secure connection to access my pfsense router using the FQDN. I already tried changing the network for NPM from the default network to host without luck. What am I missing?
Hi Christian! I have been watching your videos and this is amazzing what you are doing. I actually set this up in my home lab. everything is working fine except one thing. I am able to access my application from a device connected to different network(different ISP connection) but if i connect to the same network (ISP connection) and try to access, its loading forever. Appreciate your help
I don't know if something is cursed my setup, but if anyone else has issues getting their db to start, change from jc21/mariadb-aria:latest (which is in their own instructions) to jc21/mariadb-aria:10.4.15-innodb. They haven't updated the mariadb container in 2 years, so maybe it's just best if you go the sqllite route.
Hello sir, thanks for this! May I ask?
I have multiple virtual servers on LAN, each of them having a java app available at 33333 port. Can I use this docker nginx proxy manager to make all of them available on internet? Or do I have to redeploy each of them to run them in docker too? Thanks!
Hello from Brazil! Great Content Christian. Thanks for sharing! I wonder if it is mandatory to do it in the "/opt/ directory". Does it make a difference? Cheers!
Hey thank you man :) No it's not really important, I usually just place my containers in this folder to easily find them and follow the linux filesystem BPs, but it doesn't really make a difference technically.
@@christianlempa Capito! Tks again!
Hi there. I appreciate your work. Can you provide some link or tutorial regarding setting up load balancing using nginx proxy manager.. Cheers!!
I recently set this up aswell! It's a really awesome tool but it can sometimes corrupt your proxies, so beware. If you get a 502, it's not because your webapp isn't giving an invalid response. I think it's a bug. Just try to set it up and double check your advanced tab for any corruptions :D
Not sure what you mean, works for me 😜
Yepp, i get 502 aswell.
going to bash my head against this today and hopefully will get an awnser later today ;)
502 is the communication between proxy and target failed for some reason, either http/https, wrong ip or similar
I was storing all my volumes on my NAS, and apparently i have some issues with authorization there since the DB wont write.
I changed this to save locally on the docker-host and it worked like a charm.
Very helpful. But SSL certs need to be renewed manually!
And what IP address you see in logs when you try to surf nextcloud instance? Your proxy gateway?
Amazing tutorial, only question I have is that when I restart my server nginx is wiped and I have to restart, how can it maintain my data on a restart without me having to set everything up again?
You can also put your twitch in the description :)
I removed it because I don't stream anymore, sry 😞
Can you make a tutorial or share some resources that how to configure nginx docker-compose node.js app --scale?
blocking the "allow" to internal IP or network does not work if nginx is in the container - devs are aware of that but apparently there is no way to limit the address to be accessible from local network only
I already have it running on my setup. I used to have a manual installation of nginx + certbot, so this is more simple and quick . If I question you about this or traefik, what did you prefer?
I would say that nginx proxy manager is perfect for reverseproxies especially in smaller environments where you have a single docker node running. If you need load balancing features I would prefer traefik.
In your example at the end, wasn't the scheme set as HTTP?
Been running npm for 3 years now. What happens is, with my setup every 3 months is, I get a '502 Bad Gateway' on all new host I try to setup after that point. Have not figured out how to fix as of yet.
Useful unless you want to server static files :D
I get a "Bad Gateway" when I try to login into Nginx Proxy Manage web-gui. Anyone else getting this that can help me out? The container logs dont show much
I got the same error last night, apparently downgrading NPM image helps. I’m gonna try it later on today
@@Hasansaid51Hey did downgrading the npm image work?
Hello Christian, Good Video. I am going to assume @ the 12:00 minute mark or close to that you mention custom locations and paths, That this would be a file path is this correct? Thank you sir.
👍
hi! why do you choose the OPT directory to install containers?
Thank you!
You're welcome!
Can you do a video on how to allow applications inside docker and behind reverse proxy the see client's originating IP? This is a very useful feature (geoip, stats, logs, area access control), but there is virtually no how-tos on it anywhere in the Internet.
Great idea, but I don't think it's worth a full video. But here is what you need to do :)
Add: proxy_set_header X-Real-IP $remote_addr;
And: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
In your NPM advanced Configuration Section of your proxy host. Should do the work! Let me know if it helps
Hi Christian.
Thanks for your super great tutorials
I have two issues with NGINX PM .. I do not expect "user support" but if you have a quick response I would be very grateful.
NXINX PM will not start automatically after boot of server .. I have added restart: always in the yaml file. The weird thing is that after I added restart: always, it's enough to run docker-compose ps ..
The first time it writes "starting" .. The second time "started" ???
What do I overlook :)
The second and worst thing .. My Wordpress sites lose all formatting when I run through NGINX .. All content is "readable" but no styling at all .. Any ideas?
Hope you have the energy to answer .. And finally. Continue with your great work ..
Best Henrik
hey great video! shouldn't it be possible to replace the proxy thiny with a selfhosted VPN? like wireguard. or Is there a advantage of using the proxy thingy
Hmm a VPN is something different than a reverse proxy. VPN is just for internal usage and rev proxy to expose a service publicly
Thanks for this great tutorial!
Is there a way to test the deployment on localhost? I'm trying to run it locally, so that to validate how it works.
Thanks again!
Thanks for watching! :) Yes, you can test it locally, you might have to add an FQDN manually in the /etc/hosts file of your PC to test domains.
can you make a video of this same video but for windows users with server on hard drive?
what if you have multiple public IPs and different dockers. How you will point them into Ngnix proxy manager?
Thanks
Amazing tutorial, I have it up and running. I am having an issue though with one thing since getting this up an running, I no longer can connect to my Pi VPN with Wireguard. I've tried setting up a proxy host to go to the Pi's address and the proper port, but no dice. Any iddeas how to fix this?
Thanks mate! Not sure why, maybe join our Discord and share some more details :)
What if my service is directly on host and not in a container? How do I connect it to that particular docker network?
Yahhh :) i know, npm is epic
Can you only link the name server to ngx-pm if your own home server has a static ip? Here in Australia our home ip can change.
Is it possible to add more than one app to nginx? I already have used ngix-proxy-manger for nextcloud and now I am trying to add pihole but I don't see any ngix-proxy-manger when I run docker network list
What to do when after typing: docker-compose up -d I get: ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`. Thanks
Thank you for the video i followed it and set up mine with ease.. however am running a django application where static files are not served directly and need to be added on location.. i have looked for this everywhere I can't seem to find the syntax of adding location from the container . kindly assist
Thanks, mate. It's the same as Nginx because NPM is using it as a backend. On the documentation page, there is a section for custom configuration, maybe this helps you.
I need help of Advanced settings of proxy entry!
Hello, i have questions on 9:21
I dont understand this point u was install nextcloud and u used it to connect to nginx or by this command u installed nextcloud in nginx?
- cuz i tested it on my local environment on webapp but it didnt work from outside network its worked on local only after i add in my local dns
- if i useing custom port like 8888 i added to nginx
And its from from local by ip address or domain name of web app and enter
But from outside i must add port after domain name
How do I do this with the new portainer? Everything is named differently, and its asking for a kubernetes file instead of a docker compose.
Thank you chris!
I'm completely new to linux and i'm trying to setup my vps using docker so I can migrate my wordpress site from a hosting provider...
I have some questionsns as I'm really confused regarding performance and security.
do we need to have a webserver(nginx) when there is NPM running? because I spent some time learning to setup nginx as a webserver so I can take advantage of server level cachine with fastcgi... and now i just discovered NPM. But when people talk about NPM, they don't mention anything about the webserver or (performance in general) ...
so from my understanding we can not run both NPM and Nginx webserver at the sametime, right?
if that's the case then what are the alternatives?
i'm just seeking some guidance to know what is necessary and what is not.
my conifguration is as follows:
- oracle cloud free tier VM running an arm based ubuntu 22.04
- docker + portainer installed & running
that's all for now ... once i have a clear image on how to implemet all those elements i'll go ahead and install Wordpress, FTP, Redis & probably some firewall as well if it's needed?
Which port do I forward on my network
Having some trouble here. When I click try going to my fqdn it makes it to my opnsense login page. It also doesn't show it is secured. I have nginx setup and a proxy host pointing to my "research nextcloud server". I did open http and https on my firewall. Do I have to open a lan port to get to my nextcloud? I'm so close! haha. Great videos though, you are so awesome for all us newbies! cheers
O need help!! I’m trying to proxy a Django app, and the best practice should be to let nginx serve the staticfiles by itself, but I down know to setup this with nginx proxy manager, I’m currently using whitenoise but that is not good
i keep getting a bad gateway error, checking the logs shows access denied for the user
hi
can you make tutorial for selfhosting cloudflare freenom and ngnixproxy ?
thanks