tinyauth-web/examples/nginx/subpath.conf

26 lines
859 B
Text

# tinyauth-web under an existing site: https://www.example.com/tinyauth-web/
#
# Put these blocks inside the existing `server { }` for www.example.com.
# The URL path maps to public/. Set redirect_uri in config.php to
# https://www.example.com/tinyauth-web/callback.php
# and register the same URL as a trusted redirect URI in tinyauth.
# Test with `nginx -t`, then reload nginx. Adjust the paths and the PHP-FPM socket.
location = /tinyauth-web {
return 301 /tinyauth-web/;
}
location ^~ /tinyauth-web/ {
alias /var/www/tinyauth-web/public/;
index index.php;
location ~ ^/tinyauth-web/(.+\.php)$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/tinyauth-web/public/$1;
fastcgi_pass unix:/run/php/php8.4-fpm.sock; # match your PHP-FPM socket
}
location ~ /\. {
deny all;
}
}