server{
        server_name demo.igarson.app;
        access_log /var/log/nginx/ig/access.demo.log;
        location / {
            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;
            proxy_pass http://127.0.0.1:8012;
            proxy_read_timeout 90;
            proxy_redirect off;
            proxy_http_version 1.1;
        }
    listen 443 ssl http2; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/demo.igarson.app/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/demo.igarson.app/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server{
        server_name terrace.kermanshah.igarson.app;
        access_log /var/log/nginx/ig/access.demo.log;
        location / {
            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;
            proxy_pass http://127.0.0.1:8012;
            proxy_read_timeout 90;
            proxy_redirect off;
            proxy_http_version 1.1;
        }
    listen 443 ssl http2; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/demo.igarson.app/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/demo.igarson.app/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}



server{
    if ($host = demo.igarson.app) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
    server_name demo.igarson.app;
    listen 80;
    return 404; # managed by Certbot
}

server{
    if ($host = terrace.kermanshah.igarson.app) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
    server_name terrace.kermanshah.igarson.app;
    listen 80;
    return 404; # managed by Certbot
}