server {
	listen 80;
	server_name dev.photonbarrier.com;

#	root /home/develop/git_projects/ku-bbs;
#	index index.html;

	access_log /home/develop/nginx/logs/dev_photonbarrier_com/access.log main;
	error_log /home/develop/nginx/logs/dev_photonbarrier_com/error.log;

#	location  / {
#		proxy_pass http://0.0.0.0:8010;
#		proxy_pass https://docs.kernel.org;
#	}

	location ^~ /.well-known/acme-challenge/ {
		alias /home/develop/ssl/ssl_dev_photonbarrier_com/;
		try_files $uri =404;
	}

	rewrite ^(.*) https://dev.photonbarrier.com permanent;
}

server {
	listen 443 ssl;
	server_name dev.photonbarrier.com;

	ssl_certificate /home/develop/ssl/ssl_dev_photonbarrier_com/chained.pem;
	ssl_certificate_key /home/develop/ssl/ssl_dev_photonbarrier_com/domain.key;
	ssl_session_timeout 5m;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
	ssl_session_cache shared:SSL:50m;
	ssl_prefer_server_ciphers on;

	client_body_temp_path /home/develop/nginx/client_body_temp/;
	client_max_body_size 200m;

	access_log /home/develop/nginx/logs/dev_photonbarrier_com/access.log main;
	error_log /home/develop/nginx/logs/dev_photonbarrier_com/error.log;

#	root /home/develop/git_projects/flarum/public;
#	root /home/develop/git_projects/xiuno;
#	root /home/develop/git_projects/mdclub/public;
#	root /home/develop/git_projects/discuz/upload;
#	root /home/develop/git_projects/pb_blog/web;
	root /home/develop/git_projects/wordpress/wordpress;
#	root /home/develop/git_projects/laravel_src/laravel-blog/public;
	index index.php;

#	location  / {
#		proxy_pass http://127.0.0.1:8081;
#	}

	location  / {
		try_files $uri $uri/ /index.php?$query_string;
	}

	location ~* \.(?:manifest|appcache|html?|xml|json)$ {
		add_header Cache-Control "max-age=0";
	}

	location ~* \.(?:rss|atom)$ {
		add_header Cache-Control "max-age=3600";
	}

	location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
		add_header Cache-Control "max-age=2592000";
		access_log off;
	}

	location ~* \.(?:css|js)$ {
		add_header Cache-Control "max-age=31536000";
		access_log off;
	}

	location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
		add_header Cache-Control "max-age=2592000";
		access_log off;
	}

	location ~ \.php$ {
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
		fastcgi_pass   127.0.0.1:29999;
		fastcgi_temp_path /home/develop/nginx/fastcgi_temp/;
		fastcgi_connect_timeout 1;
		fastcgi_send_timeout 300;
		fastcgi_read_timeout 300;
		try_files $uri =404;
	}

	location ~ /\.(ht|svn|git) {
		deny all;
	}
}
