nginx with softlink

enable softlink with nginx in ubuntu

Setup nginx

doas apt install nginx

Add www-data to current user group

doas usermod -a -G `whoami` www-data

Modify nginx config

vim /etc/nginx/sites-available/default
        location / {
                try_files $uri $uri/ =404;
        }

        location /origin/ {
                disable_symlinks off;
                alias /home/q/space/tdp-scripts/origin/;
                autoindex on;
                autoindex_format html;
                autoindex_exact_size off;
                autoindex_localtime on;
        }

        location /plugin/ {
                disable_symlinks off;
                alias /home/q/space/tdp-scripts/plugin/;
                autoindex on;
                autoindex_format html;
                autoindex_exact_size off;
                autoindex_localtime on;
        }
        
         location /resource/ {
                disable_symlinks off;
                alias /home/q/space/tdp-scripts/resource/;
                autoindex on;
                autoindex_format html;
                autoindex_exact_size off;
                autoindex_localtime on;
        }

Test and restart nginx

doas nginx -t

doas systemctl restart nginx