server {

    listen  80;

    server_name  devcrmapi.nadcrm.co.uk;

    root  /var/www/nad/crm/nad_crm_api/nad-nad_crm_api_0119/public;

    index index.php index.html index.htm;

    

    location / {

        try_files $uri $uri/ /index.php?$query_string;

    }



    location ~ \.php {

        add_header Access-Control-Allow-Origin *;

        add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';

        add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,lang,access-token';

        if ($request_method = 'OPTIONS') {

            return 204;

        }


        fastcgi_pass 127.0.0.1:9072;

        fastcgi_index /index.php;

        fastcgi_split_path_info        ^(.+\.php)(/.+)$;

        fastcgi_param PATH_INFO       $fastcgi_path_info;

        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        include                       fastcgi_params;

    }

    error_log /usr/local/nginx/logs/error_nad_crm__api_log; 

    access_log /usr/local/nginx/logs/access_nad_crm_api_log; 

    #location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {

        #root ;

    #}

}