server {
	server_name  www.castinepatriot.com castinepatriot.com new.castinepatriot.com;

	root /tmp/www;

	location /.well-known {
		root /tmp/www;
	}

	location / {
		return 301 https://$host$request_uri;
	}
}

server {
        listen 443 ssl;
	server_name castinepatriot.com new.castinepatriot.com;
        ssl_certificate /etc/nginx/ssl/cp-cert.pem;
        ssl_certificate_key /etc/nginx/ssl/cp-key.pem;
	ssl_protocols	TLSv1 TLSv1.1 TLSv1.2;

	access_log  /var/log/nginx/pbp.access.log;

	location /.well-known {
		root /tmp/www;
	}

	location /robots.txt {
		alias /var/lib/django/pbp_com/templates/robots.txt;
        }

	location /media {
		root /var/lib/django/pbp_com;
	}

	location / {
		include /etc/nginx/uwsgi_params;
		uwsgi_pass unix:/var/lib/django/run/cp_com.sock;
	}
}
