0

i have apps on dir /var/www/html/app, with domain example.com how i can reverse example.com/api to /var/www/html/api.

this is my nginx config

`location / {
        root   /var/www/html/app;
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php;
    }

location /api {
        root   /var/www/html/api;
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php;
    }

    location ~ \.php$ {
        root /var/www/html/app;
        try_files $uri =404;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
            fastcgi_read_timeout 180;
    }`

how to reverse example.com/api to root /var/www/html/api

budblues
  • 1
  • 1

0 Answers0