我在Debian 9上运行Nginx服务器。我的问题是,Nginx在根目录下提供Perl文件,但是它不在别名目录中(我得到403 Forbidden)。
这是我的别名configuration:
include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; server { listen 80; server_name www.example.tld example.tld; root /srv/!example.tld/!www; index desktop.pl index.html index.htm core.tom core.pl; location /my_alias { alias /srv/!example.tld/my_alias/!www; location ~ /my_alias/\.pl$ { gzip off; fastcgi_pass unix:/var/run/fcgiwrap.socket; } } location ~ \.pl$ { gzip off; fastcgi_pass unix:/var/run/fcgiwrap.socket; } }
我真的不知道什么是错的。
所有我想要的是在整个服务器(所有别名)上执行Perl文件,理想的是在所有站点(虚拟主机)上执行Perl文件。