From 88cff0f35c57e3de855c4e040e90f480a4ac07bf Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 13 Dec 2023 20:00:54 +0530 Subject: [PATCH] Add nginx Dockerfile and nginx.conf --- nginx/Dockerfile | 2 +- nginx/nginx.conf | 33 ++++++++++++++++++++------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 3548e84..3a45637 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -2,7 +2,7 @@ FROM nginx:latest # Copy custom configuration file to Nginx configuration directory -COPY ./nginx/nginx.conf /etc/nginx/nginx.conf +COPY ./nginx.conf /etc/nginx/nginx.conf # Expose port EXPOSE 80 diff --git a/nginx/nginx.conf b/nginx/nginx.conf index fbd7119..c26cacf 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,18 +1,25 @@ # nginx.conf +events { + # Configuration related to event processing + # For most cases, the default settings suffice +} # Default server configuration -server { - listen 80; - server_name localhost; - - location / { - # Forward requests to the uWSGI server - uwsgi_pass unix:/app/myapp.sock; - include /etc/nginx/uwsgi_params; - } - - location /static/ { - # Serve static files from the Django app - alias /app/static/; +http { + server { + listen 80; + server_name localhost; + + location / { + # Forward requests to the uWSGI server + #uwsgi_pass unix:/app/dynamicweb2.sock; + uwsgi_pass dynamicweb2:8000; + include /etc/nginx/uwsgi_params; + } + + location /static/ { + # Serve static files from the Django app + alias /app/static/; + } } }