server {
    listen 80;
    listen [::]:80;
    server_name testi.aikaleima.fi;
    return 301 https://$host$request_uri;
}

server {
	listen       443 ssl http2;
    listen       [::]:443 ssl http2;
   
    ssl_certificate "/etc/ssl/wildcard-aikaleima.fi.pem";
    ssl_certificate_key "/etc/ssl/wildcard-aikaleima.fi.key";
    server_name testi.aikaleima.fi;

	ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        ssl_ciphers PROFILE=SYSTEM;
        ssl_prefer_server_ciphers on;

	location / {
    	proxy_pass http://127.0.0.1:5000;
    	proxy_set_header Upgrade $http_upgrade;
 		proxy_set_header Connection $connection_upgrade;
   		proxy_set_header Host $host;
    	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    	proxy_set_header X-Forwarded-Proto $scheme;
	}
}