HTTPSSSSSSSSSSSSSSSSS
This commit is contained in:
parent
c0e8cd9501
commit
503fca16e1
@ -8,8 +8,6 @@ services:
|
||||
image: django
|
||||
networks:
|
||||
- network
|
||||
ports:
|
||||
- "8000:8000"
|
||||
container_name: django
|
||||
restart: always
|
||||
env_file: .env
|
||||
@ -36,6 +34,18 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
nginx:
|
||||
build: nginx/
|
||||
image: nginx
|
||||
networks:
|
||||
- network
|
||||
ports:
|
||||
- '1443:443'
|
||||
container_name: nginx
|
||||
restart: always
|
||||
depends_on:
|
||||
- django
|
||||
|
||||
volumes:
|
||||
db:
|
||||
|
||||
|
10
nginx/Dockerfile
Normal file
10
nginx/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
FROM nginx
|
||||
|
||||
RUN apt-get update && apt-get -y install openssl
|
||||
RUN openssl req -x509 -newkey rsa:4096 -days 365 -nodes \
|
||||
-keyout /etc/ssl/private/bozopong.fr_key.pem \
|
||||
-out /etc/ssl/certs/bozopong.fr_cert.pem -sha256 \
|
||||
-subj "/C=FR/ST=Nouvelle Aquitaine/L=Angouleme/ \
|
||||
O=42 Angouleme/CN=bozopong.fr"
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
34
nginx/nginx.conf
Normal file
34
nginx/nginx.conf
Normal file
@ -0,0 +1,34 @@
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
sendfile on;
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /etc/ssl/certs/bozopong.fr_cert.pem;
|
||||
ssl_certificate_key /etc/ssl/private/bozopong.fr_key.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://django:8000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /ws/ {
|
||||
proxy_pass http://django:8000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_read_timeout 86400;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user