1

I am using an Nginx server.

If I access index.pl it downloads the file instead of executing it.

I'm pretty sure this is to do with /etc/nginx/sites-available/default

Here is a copy

listen 80;
listen [::]:80;

server_name domain.com;

root /var/www/domain.com;
index index.html index.php index.pl;

location / {
    try_files $uri $uri/ =404;
}

location ~ \.php$ {
    include snippets/fastcgi-php.conf;

    # With php-fpm (or other unix sockets):
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    # With php-cgi (or other tcp sockets):
    #fastcgi_pass 127.0.0.1:9000;
}

As you can see, I have already added index.pl to the end of the index list.

What else do I need to get it working?

Borodin
  • 126,100
  • 9
  • 70
  • 144
ChrisBoyd
  • 33
  • 1
  • 3
  • 2
    https://stackoverflow.com/questions/11667489/how-to-run-cgi-scripts-on-nginx, https://www.scalescale.com/tips/nginx/serve-perl-scripts-nginx/# – mob Dec 18 '17 at 21:02
  • @mob Hello, thank you for these links, they helped me solve my issue! – ChrisBoyd Dec 18 '17 at 22:06
  • @ChrisBoyd: If you have a solution then please post it as an answer. Any question you post should be much more useful to others searching for a solution to a similar issue, and at present this page is pretty much empty. – Borodin Dec 18 '17 at 22:20

0 Answers0