By Oliver
I’m currently reading the brilliant book “TDD with Python” by Harry Percival and since a few days I’m at that hairy bit where you have to get a droplet at Digital Ocean, create your domain and connect them using some strange spells.
I’m quite confident that I set up my act according to the tutorials: nameserver: $ whois webscraper.pw –> points to the Digital Oceans nameservers
At my domain registrar, I created an A-record pointing to the IP of my droplet.
This is what I do when I SSH into my droplet: $ sudo systemctl start nginx [sudo] password for pippin: $ sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful $ jobs Returns nothing … (is that right??) $ geckodriver -V geckodriver 0.18.0 $ firefox -V Mozilla Firefox 56.0
This is what Django returns: Creating test database for alias ‘default’… System check identified no issues (0 silenced). … self.browser = webdriver.Firefox() … raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: connection refused
And this is what I get from nginx: $ cat /var/log/nginx/error.log 2017/11/10 09:18:01 [error] 5449#5449: *35 connect() failed (111: Connection refused) while connecting to upstream, client: 88.130.52.47, server: staging.webscraper.pw, request: “GET / HTTP/1.1”, upstream: “http://127.0.0.1:8000/”, host: “staging.webscraper.pw” 2017/11/10 09:21:52 [error] 5449#5449: *39 connect() failed (111: Connection refused) while connecting to upstream, client: 88.130.52.47, server: staging.webscraper.pw, request: “GET / HTTP/1.1”, upstream: “http://127.0.0.1:8000/”, host: “207.154.246.158” 2017/11/10 09:21:52 [error] 5449#5449: *39 connect() failed (111: Connection refused) while connecting to upstream, client: 88.130.52.47, server: staging.webscraper.pw, request: “GET /favicon.ico HTTP/1.1”, upstream: “http://127.0.0.1:8000/favicon.ico”, host: “207.154.246.158” 2017/11/10 09:25:15 [error] 5449#5449: *42 connect() failed (111: Connection refused) while connecting to upstream, client: 88.130.52.47, server: staging.webscraper.pw, request: “GET / HTTP/1.1”, upstream: “http://127.0.0.1:8000/”, host: “207.154.246.158” 2017/11/10 10:58:30 [error] 1443#1443: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 155.94.88.58, server: staging.webscraper.pw, request: “GET / HTTP/1.0”, upstream: “http://127.0.0.1:8000/” 2017/11/10 12:40:31 [error] 1443#1443: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 88.130.52.47, server: staging.webscraper.pw, request: “GET / HTTP/1.1”, upstream: “http://127.0.0.1:8000/”, host: “staging.webscraper.pw”
If you have any ideas I’d be glad if you share them with me.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Sorry to see that your question hasn’t received an answer yet. Unfortunately, after this much time, it is unlikely that an answer for this specific question will be provided. For people still landing here via search, a Connection Refused in nginx’s error logs usually means that the upstream server (whatever is running on port 8000 in this case) isn’t running. I’d recommend to start by making sure that it is running and that the ports are configured correctly. If that doesn’t fix it, check the logs of the upstream server.
I concur with the answer given by kamain7. I had the same issue and upon further investigation into the upstream server, even though a ‘docker ps’ showed it up and running, was not serving pages properly.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.