YetiForceCompany/YetiForceCRM

View on GitHub
tests/setup/nginx/tests.conf

Summary

Maintainability
Test Coverage
##############################################
#  Best configuration for YetiForceCRM       #
#  Created by m.krzaczkowski@yetiforce.com   #
##############################################
# HTTP
server {
    listen 80 default_server;
    server_name localhost;
    root /var/www/html/public_html;
    index index.php index.html;
    #return 301 https://$server_name$request_uri;

    ## Configuration for YetiForceCRM
    include /etc/nginx/yetiforce.conf;

    ## Logs
    error_log /var/log/nginx/localhost_error.log warn;
    access_log /var/log/nginx/localhost_access.log;

    location /config {
        error_log off;
        access_log off;
    }
    location /cache {
        error_log off;
        access_log off;
    }
    location /app_data {
        error_log off;
        access_log off;
    }
    location /storage {
        error_log off;
        access_log off;
    }
    location /user_privileges {
        error_log off;
        access_log off;
    }

    ##########################
    ##       SabreDAV       ##
    ##########################
    rewrite ^/.well-known/caldav /dav.php redirect;
    rewrite ^/.well-known/carddav /dav.php redirect;

    location ~ ^(.+\.php)(.*)$ {
        try_files $fastcgi_script_name = 404;
        include /etc/nginx/fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass unix:/run/php/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO        $fastcgi_path_info;
        fastcgi_send_timeout 600;
        fastcgi_read_timeout 600;
        keepalive_timeout 600;
        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        proxy_read_timeout 600;
    }

    ##########################
    ##          PHP         ##
    ##########################
    location ~ \.php$ {
        try_files $uri =404;
        include /etc/nginx/fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_send_timeout 600;
        fastcgi_read_timeout 600;
        keepalive_timeout 600;
        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        proxy_read_timeout 600;
    }
}