mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2025-12-15 21:56:50 +01:00
36 lines
935 B
Nginx Configuration File
36 lines
935 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost ft-transcendence.com www.ft-transcendence.com;
|
|
|
|
# Redirect HTTP to HTTPS
|
|
location / {
|
|
return 301 https://www.ft-transcendence.com:1443$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name localhost ft-transcendence.com www.ft-transcendence.com;
|
|
|
|
ssl_certificate /etc/nginx/ssl/certificate.crt;
|
|
ssl_certificate_key /etc/nginx/ssl/private.key;
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
# Proxy normal HTTP requests to Django
|
|
location / {
|
|
proxy_pass http://backend:8080/;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "Upgrade";
|
|
proxy_cache_bypass $http_upgrade;
|
|
|
|
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;
|
|
}
|
|
}
|