Welcome! Log In Create A New Profile

Advanced

Dockerized Nginx not forwarding to Dockerized Gunicorn

Posted by philo 
Dockerized Nginx not forwarding to Dockerized Gunicorn
July 23, 2020 08:53AM
I am successfully running my Django web application using Gunicorn inside a docker container. This is running on a Ubuntu 16.04.6 system. What I am trying to do is have Nginx (running inside a Docker container) act as my web server and forward the http request to the gunicorn docker container. I have attached the relevant docker files. Note: At the command line I can execute my nginx image and have it successfully ping the gunicorn one by using: sudo docker container exec -ti 11e65460b93c ping django_web where 11e65460b93c is the container id of the nginx container and django_web is the name of the gunicorn container.

When I browse to http://my_ip:1337/ I get the message:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

I don't know what that further configuration is.

Thanks,
Phil



Edited 1 time(s). Last edit at 07/23/2020 08:56AM by philo.
Attachments:
open | download - Django.zip (1.6 KB)
Re: Dockerized Nginx not forwarding to Dockerized Gunicorn
July 27, 2020 08:43AM
It appears as if my ngix.conf file is not being found. When I delete it, I get the same response "Welcome to nginx..."
Re: Dockerized Nginx not forwarding to Dockerized Gunicorn
July 27, 2020 01:43PM
Changing my nginx:alpine Docker file to this fixed my issue.

RUN rm -f /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready