# Control Panel
	# Proxy /admin to our Python based control panel daemon. It is
	# listening on IPv4 only so use an IP address and not 'localhost'.
	location /admin/assets {
		alias /usr/local/lib/mailinabox/vendor/assets;
	}
	rewrite ^/admin$ /admin/;
	rewrite ^/admin/munin$ /admin/munin/ redirect;
	location /admin/ {
		proxy_pass http://127.0.0.1:10222/;
		proxy_set_header X-Forwarded-For $remote_addr;
		add_header X-Frame-Options "DENY";
		add_header X-Content-Type-Options nosniff;
		add_header Content-Security-Policy "frame-ancestors 'none';";
	}

	location ~ ^/((caldav|carddav|webdav).*)$ {
		# Z-Push doesn't like getting a redirect, and a plain rewrite didn't work either.
		# Properly proxying like this seems to work fine.
		proxy_pass https://127.0.0.1/cloud/remote.php/$1;
	}

    # These need to be updated to support External CalDAV/CardDAV
	rewrite ^/.well-known/host-meta /cloud/public.php?service=host-meta last;
	rewrite ^/.well-known/host-meta.json /cloud/public.php?service=host-meta-json last;
	rewrite ^/.well-known/carddav /cloud/remote.php/carddav/ redirect;
	rewrite ^/.well-known/caldav /cloud/remote.php/caldav/ redirect;

	# ADDITIONAL DIRECTIVES HERE