server
{
    listen 80;
    server_name _;
    index index.html index.htm index.php default.html default.htm default.php;
    root /home/wwwroot/extsuite ;

    #extman
    location /extman/default/
    {    
        root  /home/wwwroot/extsuite/extman/html/;
        rewrite ^/extman/default/images/(.*) /default/images/$1 break;
        rewrite ^/extman/default/(.*) /default/$1 break;
        expires     1h;
    }
  
    location /extman/images/
    {    
        root  /home/wwwroot/extsuite/extman/html/;
        rewrite ^/extman/images/(.*) /images/$1 break;
        expires     1h;
    }
  
    location /extman/plugins/
    {    
        root  /home/wwwroot/extsuite/extman/html/;
        rewrite ^/extman/plugins/(.*) /plugins/$1 break;
        expires     1h;
    }
  
    location /extman/cgi/ {
        root  /home/wwwroot/extsuite/extman/cgi;
        #fastcgi_pass          127.0.0.1:9001;
        fastcgi_pass          unix:/tmp/postfix.sock;
        fastcgi_index         index.cgi;
        rewrite ^/extman/cgi/(.*)\.cgi /$1.cgi break;
        include            fastcgi.conf;
    }

    #roundcube
    location ~ ^/.*\.php(/|$) {
        try_files $uri =404;
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index index.php;
        include fastcgi.conf;
        #include pathinfo.conf;
    }
    location ^~ /config/ { return 404; }
    location ^~ /temp/ { return 404; }
    location ^~ /logs/ { return 404; }

    access_log  /var/log/nginx/mail.log;
}
