LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 10:19 PM   #1
nicedreams
Member
 
Registered: Jun 2003
Location: Phoenix, AZ
Posts: 97

Rep: Reputation: 15
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, 05:16 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,187

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

Original Poster
Rep: Reputation: 15
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:44 PM
LXer: Docker Guide: Installing Traefik - a Modern Reverse Proxy for Microservices LXer Syndicated Linux News 0 07-28-2018 12:51 AM
Nginx Reverse proxy on a internal apache reverse server ITiger Linux - Software 0 04-25-2014 08:44 AM
nginx reverse proxy, home network, phpbb = fail jeradj Linux - Software 1 09-18-2009 12:34 PM
LXer: Transparent dynamic reverse proxy with nginx LXer Syndicated Linux News 0 07-12-2009 05:40 PM

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

All times are GMT -5. The time now is 09:32 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration