Right way to use Nginx directives in ISPconfig

Discussion in 'General' started by Pay87, Oct 8, 2016.

  1. Pay87

    Pay87 New Member

    Hi! I am trying to set up Moodle with Nginx and ISPconfig 3.1.
    In the past I checked the docs of the applications I wanted to run with Nginx and was able to copy the location directives inside the ISPconfig Option field for "Nginx directives" of each domain.

    When I try the same with the suggested Moodle directives the Nginx server does not start. This is the code which should be used for Nginx servers:
    server {
            listen 80;
            server_name  your-moodle.edu www.your-moodle.edu  ;
            root /usr/share/nginx/html/your-moodle;
        index index.php index.html index.htm;
        location / {
            # First attempt to serve request as file
            try_files $uri $uri/index.php;
        # pass the PHP scripts to FastCGI server listening on
            location ~ [^/]\.php(/|$) {
              fastcgi_split_path_info ^(.+?\.php)(/.*)$;
              if (!-f $document_root$fastcgi_script_name) {
                      return 404;
              #free to choose between port or sock file.
              fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
              #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
              fastcgi_index index.php;
              include fastcgi_params;
    I just tried all the location blocks only, but I get a warning that Nginx did not restart after applying the location blocks. Does somebody know how it is the right way to set it up with ISPconfig?

    Thank you!

Share This Page