moodle.conf 952 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. root /var/www/moodle;
  5. # Add index.php to the list if you are using PHP
  6. index index.php index.html index.htm;
  7. server_name localhost;
  8. access_log /var/log/nginx/moodle-access.log;
  9. error_log /var/log/nginx/moodle-error.log;
  10. # Allow favicon.ico, robots.txt, .well-known/
  11. # Deny *.txt, *.log, .*/*.php, .*, *.json, .lock, *.ht
  12. include snippets/allowed.conf;
  13. include snippets/denied.conf;
  14. location / {
  15. # First attempt to serve request as file, then
  16. # as directory, then fall back to displaying a 404.
  17. try_files $uri $uri/ =404;
  18. }
  19. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  20. #
  21. location ~ [^/]\.php(/|$) {
  22. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  23. fastcgi_index index.php;
  24. fastcgi_pass unix:/run/php/php7.2-fpm.sock;
  25. include fastcgi_params;
  26. fastcgi_param PATH_INFO $fastcgi_path_info;
  27. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  28. }
  29. }