server {
    listen 80;
    return 301 https://civilhub.org$request_uri;
}

server {
    listen 443;
    ssl on;
    server_name civilhub.org mobile.civilhub.org;    
    ssl_certificate /srv/cert/ssl-bundle.crt;
    ssl_certificate_key /srv/cert/places.key;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:AES128:AES256:RC4-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK;
    root /srv/places/;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
    client_max_body_size 70M;

    location /static/ { # STATIC_URL
        autoindex off;
        alias /srv/places/static/;
        expires 30d;
    }

    location /media/ { # MEDIA_URL
	    autoindex off;
        alias /srv/places/media/;
        client_max_body_size 20M;
        expires 30d;
    }

    location / {
        include uwsgi_params;
        uwsgi_pass places:8889;

        #dla appery
        if ($http_origin ~ "appery.io$") {
            add_header "Access-Control-Allow-Origin" $http_origin;
        }
    }
}
