Moodle in nginx https

Moodle in nginx https

by Newton Design -
Number of replies: 0

Nginx downloads the php

My configuration

# configuration file /etc/nginx/sites-enabled/elearning.its.com.do:

server {


        server_name elearning.its.com.do;

        #return 404; # managed by Certbot

#       root /var/www/html/moodle/;


#       index index.php;


        location / {


                try_files $uri $uri/ /index.php;

                }


        location ~ \.php$ {


                proxy_set_header Host $http_host;

                proxy_set_header X-Forwarded-Host $http_host;

                proxy_set_header X-Real-IP $remote_addr;

 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_set_header X-FORWARDED-PROTO https;


        }

        location ~ [^/]\.php(/|$) {

                #fastcgi_split_path_info  ^(.+\.php)(/.+)$;

                include fastcgi_params;

                fastcgi_index   index.php;

                #fastcgi_pass   172.16.50.206:8080;

                #include        fastcgi_params;


        if (!-e $request_filename) {

           rewrite ^(.*\.php)(/)(.*)$ $1?file=/$3 last;


                }

                fastcgi_param   PATH_INFO       $fastcgi_path_info;

                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_n$


 proxy_set_header X-Real-IP $remote_addr;

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_set_header X-FORWARDED-PROTO https;


        }

        location ~ [^/]\.php(/|$) {

                #fastcgi_split_path_info  ^(.+\.php)(/.+)$;

                include fastcgi_params;

                fastcgi_index   index.php;

                #fastcgi_pass   172.16.50.206:8080;

                #include        fastcgi_params;


        if (!-e $request_filename) {

           rewrite ^(.*\.php)(/)(.*)$ $1?file=/$3 last;


                }

                fastcgi_param   PATH_INFO       $fastcgi_path_info;

                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;


                }

 location ~ /\.ht {

                deny all;

        }


        listen 443 ssl;

        # managed by Certbot

                ssl_certificate /etc/letsencrypt/live/elearning.its.com.do/fullchain.pem;

        # managed by Certbot

                ssl_certificate_key /etc/letsencrypt/live/elearning.its.com.do/privkey.pem;

        # managed by Certbot

                include /etc/letsencrypt/options-ssl-nginx.conf;

        # managed by Certbot

                ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

        # managed by Certbot


        #}

}


Average of ratings: -