LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 11-03-2019, 09:19 PM   #1
nicedreams
Member
 
Registered: Jun 2003
Location: Phoenix, AZ
Posts: 112

Rep: Reputation: 17
Close docker ports after config of Nginx reverse proxy?


I'm using a docker container for Gotify on DigitalOcean using:

docker run -d \
--name gotify \
-p 8899:80 \
-v /opt/docker-data/gotify/data:/app/data \
--restart always \
gotify/server:latest

which is working fine going to http://sub.domain.com:8899

I then installed Nginx locally on the server and configured it for reverse proxy with letsencrypt and that is working now by going to https://sub.domain.com without typing in :8899

The issue I'm having is that port 8899 is still open to the internet automatically when I run the container and I want to run the Gotify docker container without access to 8899 and only working through the local Nginx reverse proxy on port 80.

I'm confused on how to do this. I looked into creating new docker networks, but Gotify conflicts at port 80 with my local Nginx install at port 80 since it seems I use port 8899:80 within the Gotify image?
 
Old 11-05-2019, 04:16 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably you need to listen on localhost:8899 and deny from outside:8899. probably a firewall config
 
Old 11-05-2019, 09:54 PM   #3
nicedreams
Member
 
Registered: Jun 2003
Location: Phoenix, AZ
Posts: 112

Original Poster
Rep: Reputation: 17
Found my answer at: https://www.reddit.com/r/docker/comm...er_once_using/

Answer is to use:

-p 127.0.0.1:8899:80

Now only works via local Nginx proxy with port :8899 not forwarded to the outside anymore.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nextcloud login loop on Nginx behind Nginx reverse proxy horizn Linux - Server 0 12-27-2018 02:44 PM
LXer: Docker Guide: Installing Traefik - a Modern Reverse Proxy for Microservices LXer Syndicated Linux News 0 07-27-2018 11:51 PM
Nginx Reverse proxy on a internal apache reverse server ITiger Linux - Software 0 04-25-2014 07:44 AM
nginx reverse proxy, home network, phpbb = fail jeradj Linux - Software 1 09-18-2009 11:34 AM
LXer: Transparent dynamic reverse proxy with nginx LXer Syndicated Linux News 0 07-12-2009 04:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 12:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration