From 6598e120e611be57d06c9045d39c272fc20eac4c Mon Sep 17 00:00:00 2001 From: Ali Najmabadi Date: Tue, 26 Nov 2024 10:06:37 +0330 Subject: [PATCH] chore: add some redirects and trailing slash --- liara_nginx.conf | 107 ++++++++++++++++++++++++++++++----------------- 1 file changed, 69 insertions(+), 38 deletions(-) diff --git a/liara_nginx.conf b/liara_nginx.conf index c71cc3f0..b64474aa 100644 --- a/liara_nginx.conf +++ b/liara_nginx.conf @@ -12,6 +12,18 @@ location = /404.html { internal; } + + +location / { + + if ($request_uri !~ /$) { + return 301 $request_uri/; + } + +} + + + # location / { # rewrite ^/(.*)/$ /$1 permanent; # } @@ -1409,15 +1421,15 @@ location ~ ^/deployments/angular/?$ { return 301 /paas/angular/getting-started; } -location ~ ^/app-deploy/netcore/envs?$ { +location ~ ^/app-deploy/netcore/envs/?$ { return 301 /paas/dotnet/how-tos/set-envs; } -location ~ ^/apps/volumes?$ { +location ~ ^/apps/volumes/?$ { return 301 /paas/disks/about; } -location ~ ^/app-features/applets?$ { +location ~ ^/app-features/applets/?$ { return 301 /paas/docker/related-apps/applets; } @@ -1433,7 +1445,7 @@ location ~ ^/app-deploy/netcore/websocket/?$ { return 301 /paas/dotnet/how-tos/use-websocket; } -location ~ ^/managing-multiple-acounts?$ { +location ~ ^/managing-multiple-acounts/?$ { return 301 /references/console/manage-accounts; } @@ -1445,7 +1457,7 @@ location ~ ^/apps/console/?$ { return 301 /references/console/about; } -location ~ ^/app-deploy/netcore/email?$ { +location ~ ^/app-deploy/netcore/email/?$ { return 301 /email-server/how-tos/connect-via-platform/dotnet; } @@ -1453,15 +1465,15 @@ location ~ ^/app-deploy/netcore/disks/?$ { return 301 /paas/dotnet/how-tos/use-disk; } -location ~ ^/one-click-apps/([^/]+)/how-tos/quick-start$ { +location ~ ^/one-click-apps/([^/]+)/how-tos/quick-start/$ { return 301 /one-click-apps/$1/quick-start; } -location ~ ^/instructions/nextjs?$ { +location ~ ^/instructions/nextjs/?$ { return 301 /paas/nextjs/getting-started; } -location ~ ^/instructions/nextjs?$ { +location ~ ^/instructions/nextjs/?$ { return 301 /paas/nextjs/getting-started; } @@ -1469,11 +1481,11 @@ location ~ ^/instructions/golang/?$ { return 301 /paas/docker/related-apps/go; } -location ~ ^/apps/logs?$ { +location ~ ^/apps/logs/?$ { return 301 /paas/details/observations/about; } -location ~ ^/app-deploy/php/cloud-storage?$ { +location ~ ^/app-deploy/php/cloud-storage/?$ { return 301 /object-storage/how-tos/connect-via-platform/dotnet; } @@ -1489,115 +1501,134 @@ location ~ ^/app-deploy/netcore/browser/?$ { return 301 /paas/dotnet/how-tos/deploy-app; } -location ~ ^/databases/mysql-mariadb/install?$ { +location ~ ^/databases/mysql-mariadb/install/?$ { return 301 /dbaas/mysql/quick-setup; } -location ~ ^/app-deploy/flask/desktop?$ { +location ~ ^/app-deploy/flask/desktop/?$ { return 301 /paas/flask/how-tos/deploy-app; } -location ~ ^/clients/cli?$ { +location ~ ^/clients/cli/?$ { return 301 /references/cli/about; } -location ~ ^/app-deploy/django/desktop?$ { +location ~ ^/app-deploy/django/desktop/?$ { return 301 /paas/django/how-tos/deploy-app; } -location ~ ^/instructions/prestashop?$ { +location ~ ^/instructions/prestashop/?$ { return 301 /one-click-apps/prestashop/quick-start/; } -location ~ ^/deployments/laravel?$ { +location ~ ^/deployments/laravel/?$ { return 301 /paas/laravel/how-tos/deploy-app/; } -location ~ ^/apps/environment-variables?$ { +location ~ ^/apps/environment-variables/?$ { return 301 /paas/details/envs/; } -location ~ ^/databases/mysql-mariadb/backup?$ { +location ~ ^/databases/mysql-mariadb/backup/?$ { return 301 /dbaas/mariadb/how-tos/create-backup; } -location ~ ^/apps/fixed-ip?$ { +location ~ ^/apps/fixed-ip/?$ { return 301 /paas/details/static-ip/; } -location ~ ^/deployments/static?$ { +location ~ ^/deployments/static/?$ { return 301 /paas/static/how-tos/deploy-app/; } -location ~ ^/buckets/domain?$ { +location ~ ^/buckets/domain/?$ { return 301 /object-storage/add-domain/; } -location ~ ^/wp-plus/domain?$ { +location ~ ^/wp-plus/domain/?$ { return 301 /paas/domains/add-domain/; } -location ~ ^/wp-plus/domain?$ { +location ~ ^/wp-plus/domain/?$ { return 301 /paas/domains/add-domain/; } -location ~ ^/deployments/docker?$ { +location ~ ^/deployments/docker/?$ { return 301 /paas/docker/how-tos/deploy-app/; } -location ~ ^/app-deploy/vue/desktop?$ { +location ~ ^/app-deploy/vue/desktop/?$ { return 301 /paas/vue/how-tos/deploy-app/; } -location ~ ^/apps/disks?$ { +location ~ ^/apps/disks/?$ { return 301 /paas/disks/about/; } -location ~ ^/instructions/rabbitmq?$ { +location ~ ^/instructions/rabbitmq/?$ { return 301 /dbaas/rabbitmq/quick-setup; } -location ~ ^/apps/health-check?$ { +location ~ ^/apps/health-check/?$ { return 301 /paas/details/health-check/; } -location ~ ^/apps/health-check?$ { +location ~ ^/apps/health-check/?$ { return 301 /paas/details/health-check/; } -location ~ ^/deployments/nodejs?$ { +location ~ ^/deployments/nodejs/?$ { return 301 /paas/nodejs/how-tos/deploy-app/; } -location ~ ^/one-click-apps/wordpress?$ { +location ~ ^/one-click-apps/wordpress/?$ { return 301 /one-click-apps/wordpress/quick-start/; } -location ~ ^/app-deploy/php/desktop?$ { +location ~ ^/app-deploy/php/desktop/?$ { return 301 /paas/php/how-tos/deploy-app/; } -location ~ ^/domains/ssl?$ { +location ~ ^/domains/ssl/?$ { return 301 /paas/domains/enable-ssl/; } -location ~ ^/app-deploy/laravel/desktop?$ { +location ~ ^/app-deploy/laravel/desktop/?$ { return 301 /paas/laravel/how-tos/deploy-app/; } -location ~ ^/apps/ftp?$ { +location ~ ^/apps/ftp/?$ { return 301 /paas/disks/ftp-access/; } -location ~ ^/buckets/transfer?$ { +location ~ ^/buckets/transfer/?$ { return 301 /object-storage/how-tos/move-bucket/; } -location ~ ^/app-deploy/netcore/cli?$ { +location ~ ^/app-deploy/netcore/cli/?$ { return 301 /paas/dotnet/how-tos/deploy-app/; } -# 200 - page 20 +location ~ ^/app-deploy/laravel/desktop/?$ { + return 301 /paas/laravel/how-tos/deploy-app/; +} + +location ~ ^/app-deploy/php/desktop/?$ { + return 301 /paas/php/how-tos/deploy-app/; +} + +location ~ ^/app-deploy/nextjs/envs/?$ { + return 301 /paas/nextjs/how-tos/set-envs/; +} + +location ~ ^/app-deploy/nextjs/envs/?$ { + return 301 /paas/nextjs/how-tos/set-envs/; +} + +location ~ ^/.*?/applets/?$ { + return 301 /paas/details/events/; +} +