admin cloud-section (root) initial commit
c29b888 8 years ago
1 contributor
40 lines | 0.905kb
server {
	listen         80;
	server_name    action.paris12.pcf.fr;
	return         301 https://$server_name$request_uri;
}

server {
	listen 443 ssl;
	server_name action.paris12.pcf.fr;

	access_log /var/log/nginx/action/access.log;
	error_log /var/log/nginx/action/error.log;

	ssl_certificate /etc/letsencrypt/live/action.paris12.pcf.fr/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/action.paris12.pcf.fr/privkey.pem;

	root /var/www/action;

	index index.php;

	location ~ ^/admin {
		auth_basic "Halte ! Qui va la ?";
		auth_basic_user_file /etc/nginx/htpasswd;
		location ~ \.php {
			include api_fastcgi.conf;
		}
	}

	location ~ /(|index.php|create_poll.php?type=.+)$ {
		auth_basic "Acces a la creation de sondage restreint...";
		auth_basic_user_file /etc/nginx/htpasswd;
		location ~ \.php {
			include api_fastcgi.conf;
		}
	}

	location ~ \.php {
		include api_fastcgi.conf;
	}
}