From fb5ece74bc0e0e839519a49d6a8fdb05a0b3884d Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 7 Jul 2021 17:55:50 -0400 Subject: [PATCH] changes to www nginx conf --- Nginx/Server Blocks/libraryofcode.org.conf | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Nginx/Server Blocks/libraryofcode.org.conf b/Nginx/Server Blocks/libraryofcode.org.conf index 40bf65d..c53869e 100644 --- a/Nginx/Server Blocks/libraryofcode.org.conf +++ b/Nginx/Server Blocks/libraryofcode.org.conf @@ -9,11 +9,27 @@ server { root /var/www/wordpress; index index.php; - location ~ \.php$ { - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/run/php/php7.2-fpm.sock; - } location / { try_files $uri $uri/ /index.php?$args; } + + location ~ \.php$ { + #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_pass unix:/run/php/php7.4-fpm.sock;; + #The following parameter can be also included in fastcgi_params file + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { + expires max; + log_not_found off; + } + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } }