diff --git a/conf/nginx.conf b/conf/nginx.conf index 61fa0097..b033ab09 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -39,5 +39,11 @@ server { client_max_body_size 20M; } + # Webfinger configuration. + location = /.well-known/webfinger { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/bin/mailinabox-webfinger.php; + fastcgi_pass unix:/tmp/php-fastcgi.www-data.sock; + } } diff --git a/setup/web.sh b/setup/web.sh index 8a2df8d5..53f70d00 100755 --- a/setup/web.sh +++ b/setup/web.sh @@ -31,6 +31,10 @@ rm -f /etc/init.d/php-fastcgi ln -s $(pwd)/conf/phpfcgi-initscript /etc/init.d/php-fastcgi update-rc.d php-fastcgi defaults +# Put our webfinger server script into a well-known location. +cp tools/webfinger.php /usr/bin/mailinabox-webfinger.php +chown www-data.www-data /usr/bin/mailinabox-webfinger.php + # Start services. service nginx restart service php-fastcgi restart diff --git a/tools/webfinger.php b/tools/webfinger.php new file mode 100755 index 00000000..2192e089 --- /dev/null +++ b/tools/webfinger.php @@ -0,0 +1,9 @@ + $resource, + ), JSON_PRETTY_PRINT); +?> +