Make /@ URL pass to "web" + redirect to /u/username if activity+json

This commit is contained in:
Niko 2022-02-09 14:26:41 +01:00
parent d775e56c35
commit 83e34a6dd4
2 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,7 @@ server {
server_name _;
# Web client
location ~ ^(/$|/web) {
location ~ ^(/$|/@|/web) {
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;

View File

@ -1,3 +1,11 @@
<?php
echo 'hola';
$uri = trim($_SERVER['REQUEST_URI']);
# Example: /@username
if (preg_match('/^\/\@[a-zA-Z0-9\-\_]+/', $uri))
{
if ($_SERVER['HTTP_ACCEPT'] === 'application/activity+json') {
header('Location: /u/'.substr($uri, 2)); die();
}
}