barryserver-git
Barry Splitting into more pages + commit pages a6603d5 (2 years, 3 months ago)diff --git a/pages.conf b/pages.conf new file mode 100644 index 0000000..966bdd9 --- /dev/null +++ b/pages.conf @@ -0,0 +1,32 @@ +location /style.css { + try_files $uri $uri/ =404; +} +location ~ ^/(tree|index|blob|commit|commits)\.php { + include /etc/nginx/fastcgi.conf; + fastcgi_pass unix:/run/php-fpm/php-fpm.sock; +} +location / { + rewrite ^/([^/]+)(/?)$ /tree.php?repo=$1; + + rewrite ^/([^/]+)/tree$ /tree.php?repo=$1; + rewrite ^/([^/]+)/tree/([^/]*)(/?)$ /tree.php?repo=$1&object=$2; + rewrite ^/([^/]+)/tree/([^/]*)/(.*)$ /tree.php?repo=$1&object=$2&path=$3; + + rewrite ^/([^/]+)/blob$ /blob.php?repo=$1; + rewrite ^/([^/]+)/blob/([^/]*)(/?)$ /blob.php?repo=$1&object=$2; + rewrite ^/([^/]+)/blob/([^/]*)/(.*)$ /blob.php?repo=$1&object=$2&path=$3; + + rewrite ^/([^/]+)/raw$ /blob.php?raw&repo=$1; + rewrite ^/([^/]+)/raw/([^/]*)(/?)$ /blob.php?raw&repo=$1&object=$2; + rewrite ^/([^/]+)/raw/([^/]*)/(.*)$ /blob.php?raw&repo=$1&object=$2&path=$3; + + rewrite ^/([^/]+)/commit$ /commit.php?repo=$1; + rewrite ^/([^/]+)/commit/([^/]*)(/?)$ /commit.php?repo=$1&object=$2; + rewrite ^/([^/]+)/commit/([^/]*)/(.*)$ /commit.php?repo=$1&object=$2&path=$3; + + rewrite ^/([^/]+)/commits$ /commits.php?repo=$1; + rewrite ^/([^/]+)/commits/([^/]*)(/?)$ /commits.php?repo=$1&object=$2; + rewrite ^/([^/]+)/commits/([^/]*)/(.*)$ /commits.php?repo=$1&object=$2&path=$3; + + try_files $uri $uri/ =404; +}