Вот код:
upstream personal_portfolio {
server web:8000;
}
if (${USE_SSL} = True) {
server {
listen 443 ssl;
location / {
proxy_pass http://personal_portfolio;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /static/ {
alias /home/app/web/staticfiles/;
}
location /media/ {
alias /home/app/web/mediafiles/;
}
}
}
server {
listen 80;
location / {
proxy_pass http://personal_portfolio;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /static/ {
alias /home/app/web/staticfiles/;
}
location /media/ {
alias /home/app/web/mediafiles/;
}
}
Вот ошибка:
ginx: [emerg] "if" directive is not allowed here in /etc/nginx/conf.d/nginx.conf:5
Что делать?