## Bu dosya ansible tarafindan yonetilmektedir!
## Burada yapilan degisikliklerin uzerine yazilir!!
{{ ansible_managed }}

upstream django-admin {
    server unix:///var/run/ahtapot-gkts/gkts-admin.sock; 
}

upstream django-developer {
    server unix:///var/run/ahtapot-gkts/gkts-developer.sock; 
}

server {
    listen      {{ nginx['admin']['listen'] }};
    server_name {{ nginx['admin']['server_name'] }};
    charset     utf-8;

    ssl                  on;
    ssl_certificate      {{ nginx['certificate']['destination'] }};
    ssl_certificate_key  {{ nginx['key']['destination'] }};

    ssl_session_timeout  5m;

    ssl_protocols  TLSv1;
    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers   on;

    client_max_body_size 75M;

    access_log      {{ nginx['admin']['access_log'] }};
    error_log  	    {{ nginx['admin']['error_log'] }};

    location /static_media  {
	root /var/opt/ahtapot-gkts/admin;
    }

    location /static {
	root /var/opt/ahtapot-gkts/admin;
    }

    location / {
        uwsgi_pass  django-admin;
        include     /var/opt/ahtapot-gkts/admin/uwsgi_params; 
    }
}

server {
    listen      {{ nginx['developer']['listen'] }};
    server_name {{ nginx['developer']['server_name'] }};
    charset     utf-8;

    ssl                  on;
    ssl_certificate      {{ nginx['certificate']['destination'] }};
    ssl_certificate_key  {{ nginx['key']['destination'] }};

    ssl_session_timeout  5m;

    ssl_protocols  TLSv1;
    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers   on;

    client_max_body_size 75M;

    access_log      {{ nginx['developer']['access_log'] }};
    error_log  	    {{ nginx['developer']['error_log'] }};

    location /static_media  {
        root /var/opt/ahtapot-gkts/developer;
    }

    location /static {
        root /var/opt/ahtapot-gkts/developer;
    }

    location / {
        uwsgi_pass  django-developer;
        include     /var/opt/ahtapot-gkts/developer/uwsgi_params;
    }
}
