diff --git a/Nginx/Server Blocks/pbx.libraryofcode.org.conf b/Nginx/Server Blocks/pbx.libraryofcode.org.conf index 07c0fbc..1c1b642 100644 --- a/Nginx/Server Blocks/pbx.libraryofcode.org.conf +++ b/Nginx/Server Blocks/pbx.libraryofcode.org.conf @@ -6,20 +6,34 @@ server { ssl_certificate /etc/nginx/ssl/org.chain.crt; ssl_certificate_key /etc/nginx/ssl/org.key.pem; - client_max_body_size 230M; - client_body_timeout 1h; - - root /opt/fusionpbx; - index index.php; + client_max_body_size 230M; + client_body_timeout 1h; - location / { - try_files $uri $uri/ /index.php?$query_string; - } + root /var/www/html; + index index.html index.htm index.php; - location ~ \.php$ { - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } + location / { + try_files $uri $uri/ =404; + } + + location ~ \.php$ { + include snippets/fastcgi-php.conf; # server defaults are good + fastcgi_pass unix:/run/php/php7.3-fpm-asterisk.sock; + fastcgi_param HTACCESS on; # disables FreePBX htaccess warning + proxy_read_timeout 800; + } + + # Block access to orangehrm and orangehrm-5.1 directories + location ~ ^/(orangehrm|orangehrm-5\.1)(/|$) { + deny all; + return 403; + } + + # Disallows the things that the FreePBX .htaccess files disallow + location ~ (/\.ht|/\.git|\.ini$|/libraries|/helpers|/i18n|/node|/views/.+php$) { + deny all; + } + + # From the api module .htaccess file + rewrite ^/admin/api/([^/]*)/([^/]*)/?(.*)?$ /admin/api/api.php?module=$1&command=$2&route=$3 last; }