2 Nginx
Breizh edited this page 2 years ago

Vhosts Nginx

server {
	listen [::]:80;
	listen *:80;

	server_name domain.tld;

	include common.conf;

	access_log /var/log/nginx/<user>_access.log;
	error_log /var/log/nginx/<user>_error.log;

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

	# Configuration spécifique du vhost s'il n'a pas de HTTPS
	# (virer la redirection dans ce cas)
}

server {
	listen [::]:443 ssl http2;
	listen *:443 ssl http2;

	server_name domain.tld;

	include common.conf;
	include ssl.conf;

	ssl_certificate             /etc/dehydrated/certs/<user>.planet-casio.com/fullchain.pem;
	ssl_certificate_key         /etc/dehydrated/certs/<user>.planet-casio.com/privkey.pem;

	access_log /var/log/nginx/<user>_access.log;
	error_log /var/log/nginx/<user>_error.log;

	# Configuration spécifique du vhost
}