Score:0

NGINX- different web paths to different folders

in flag

I need to redirect different web paths to different folders on server.

http://test.local/site1/ => /srv/site_1/src/public
http://test.local/site2/ => /srv/site_2

tried such config, but it does not work

server {
    server_name test.local;
    root /srv;

    index index.html;

    location /site1/ {
        alias /srv/site_1/src/public;

        try_files $uri $uri/ /index.php?$args;

        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location /site2/ {
        alias /srv/site_2;

        try_files $uri $uri/ /index.php?$args;

        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }
}
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.