nginx 部署 suitecrm 的完整配置文件

nginx 部署 suitecrm 的完整配置文件

此配置文件包含了 suitecrm 部署 .htaccess 转 nginx 配置的完整内容。

    server {
        listen          80;

        server_name     suitecrm.test.com;
        root            /var/webapp/suitecrm;
        index           index.php;
        charset         UTF-8;

        access_log      /var/log/nginx/suitecrm.test.com.access.log  main;
        error_log       /var/log/nginx/suitecrm.test.com.error.log;

        rewrite ^/cache/jsLanguage/(.._..)\.js$       /index.php?entryPoint=jslang&module=app_strings&lang=$1 permanent;
        rewrite ^/cache/jsLanguage/(\w*)/(.._..)\.js$ /index.php?entryPoint=jslang&module=$1&lang=$2 permanent;

        location ~ \.php$ {
            try_files           $uri =404;
            fastcgi_index       index.php;
            fastcgi_param       SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            include             fastcgi_params;
            fastcgi_pass        unix:/run/php-fpm-www.socket;
            fastcgi_send_timeout 600s;
            fastcgi_read_timeout 600s;
            fastcgi_keep_conn   on;
        }

        location ~* ^.+\.(js|css|ico|ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
            access_log off;
            #log_not_found off;
            expires max;
        }

        location ~* ".*\.log$|/+not_imported_.*\.txt|/+(soap|cache|xtemplate|data|examples|include|log4php|metadata|modules)/+.*\.(php|tpl)|/+emailmandelivery\.php|/+upload|/+cache/+diagnostic|/+files\.md5$" {
            deny  all;
        }

        location ~ /\.ht {
            deny  all;
        }

    }

注意:此配置文件可能存在错漏,仅供参考。