Add nginx Dockerfile and nginx.conf
This commit is contained in:
parent
518c0d060a
commit
88cff0f35c
2 changed files with 21 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
http {
|
||||
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 / {
|
||||
# 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/;
|
||||
location /static/ {
|
||||
# Serve static files from the Django app
|
||||
alias /app/static/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue