# The home-server project produces a multi-purpose setup using Ansible. # Copyright © 2018 Y. Gablin, under the GPL-3.0-or-later license. # Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing. # function /php...(doc_root /... prefix /... script /... pathinfo) { # # fastcgi_pass: # proxy_https://…host…:proxy_port/prefix/script/pathinfo?query_string # ⇓ # /doc_root/script (+ pathinfo + query_string) # # } location ^~ /php... { internal; autoindex off; location ~ ^/php\.\.\.(?.*)/\.\.\.(?.*)/\.\.\.(?.*)/\.\.\.(?.*)$ { fastcgi_pass unix:/run/shared_sockets/php-fpm; fastcgi_index index.php; fastcgi_send_timeout 60m; fastcgi_read_timeout 60m; include fastcgi.conf; fastcgi_param HTTPS $proxy_https if_not_empty; fastcgi_param REQUEST_SCHEME $proxy_https if_not_empty; fastcgi_param SERVER_PORT $proxy_port if_not_empty; fastcgi_param SCRIPT_FILENAME $p_doc_root$p_script; fastcgi_param SCRIPT_NAME $p_prefix$p_script; fastcgi_param REQUEST_URI $p_prefix$p_script$p_pathinfo$is_args$query_string; fastcgi_param DOCUMENT_URI $p_prefix$p_script$p_pathinfo; fastcgi_param DOCUMENT_ROOT $p_doc_root; fastcgi_param PATH_INFO $p_pathinfo if_not_empty; } }