HTTPSSSSSSSSSSSSSSSSS
This commit is contained in:
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user