cirandas.net-etc

ref: main

nginx/conf.d/web.conf


port_in_redirect off;
root /home/cirandas/noosfero-ecosol/public;

include conf.d/maintenance.conf;

access_log /home/cirandas/log/access.log combined;
error_log /home/cirandas/log/error.log;

location ~ '.+\.php$' {
	return 404;
}

location ~ '/assets/.+-[^\.]{64}\..+$' {
	add_header Cache-Control public;
	expires 1y;
	try_files $uri @proxy;
}

location / {
	if ($http_user_agent = "") {
		return 444;
	}

	if ($http_user_agent = "-") {
		return 444;
	}

	include conf.d/user-agent-denylist.conf;

	try_files index.html $uri @proxy;
}

location @proxy {
	proxy_buffers               4 256k;
	proxy_buffer_size           256k;
	proxy_busy_buffers_size     256k;
	proxy_temp_file_write_size  256k;

	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-For $remote_addr;
	proxy_set_header X-Forwarded-Proto $scheme;
	proxy_set_header Host $host;
	proxy_pass http://cirandas;
}