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

    #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;
    }

    #extmail
    location /extmail/default/ {
        root /home/wwwroot/extsuite/extmail/html/;
        rewrite ^/extmail/default/images/(.*) /default/images/$1 break;
        rewrite ^/extmail/default/(.*) /default/$1 break;
        expires     1h;
    }

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

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