32 lines
881 B
Django/Jinja
32 lines
881 B
Django/Jinja
upstream backend_servers {
|
|
server {{ backend_ip_1 }}:80;
|
|
server {{ backend_ip_2 }}:80;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name {{ proxy_name }};
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name {{ proxy_name }};
|
|
|
|
ssl_certificate /etc/nginx/ssl/{{ proxy_name }}.crt;
|
|
ssl_certificate_key /etc/nginx/ssl/{{ proxy_name }}.key;
|
|
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_ciphers "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384";
|
|
|
|
location / {
|
|
proxy_pass http://backend_servers;
|
|
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;
|
|
}
|
|
}
|