nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.29k stars 325 forks source link

how write if block like in nginx for nginx unit with php #988

Closed allanian closed 8 months ago

allanian commented 8 months ago

Hello, i have that block in my current website, for redirect old requests to old website api, can you help me?

      set $root /var/www/new/public;
      # REDIRECT API_V3/V3 to old site
      if ($request_uri ~ .*api_v2.*) {
          set $root /var/www/old/public;
      }

      if ($request_uri ~ .*api_v3.*) {
        set $root /var/www/old/public;
      }
      root $root;