mikkom
By:
mikkom

Installed one click app Docker 17.03.0-ce on 16.04, how do I configure nginx?

March 6, 2017 454 views
Nginx One-Click Install Apps Ubuntu 16.04

I only know that nginx is running because I managed to install Loomio via docker and it runs fine - except that I'm unable to follow any instructions for redirecting www.mysite.com to mysite.com. When I try to check status of nginx is claims that it is not installed - how is it running at all? How to configure it?

2 Answers

I have same problem. I have installed nginx and configure with default setting. I get success via console ($curl http://localhost) but I get ERRCONNECTIONTIMEDOUT error http://DROPLETIP in browser in the same way with http://example.com domain. Switching the machines off/stop by running the docker stop command did not change anything.

Can you offer any guide or tutorial for production environment (specifically docker)? Thanks for your time and interest

My problem was that the firewall settings did not define a rule for port 80.

# Before
$ ufw status
To                         Action      From
--                         ------      ----
22                         LIMIT       Anywhere                  
2375/tcp                   ALLOW       Anywhere                  
2376/tcp                   ALLOW       Anywhere                  
22 (v6)                    LIMIT       Anywhere (v6)             
2375/tcp (v6)              ALLOW       Anywhere (v6)             
2376/tcp (v6)              ALLOW       Anywhere (v6) 

I add a rule for 80/tcp,

$ ufw add 80/tcp

So,

$ ufw status                                                                                                                         
Status: active

To                         Action      From
--                         ------      ----
22                         LIMIT       Anywhere                  
2375/tcp                   ALLOW       Anywhere                  
2376/tcp                   ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
22 (v6)                    LIMIT       Anywhere (v6)             
2375/tcp (v6)              ALLOW       Anywhere (v6)             
2376/tcp (v6)              ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6) 

And now, i access both http://DROPLET_IP and http://example.com.

I hope that will be useful for you.

Have another answer? Share your knowledge.