user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    client_max_body_size 1000m;
    client_body_buffer_size 600m;
    client_header_buffer_size 8m;

    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    keepalive_timeout  65;
    gzip_static  on;

    #include /etc/nginx/conf.d/*.conf;
    server {
    listen       80;
    server_name  localhost;

    access_log  /var/log/nginx/host.access.log  main;
    error_log  /var/log/nginx/error.log  error;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        error_page 405 =200 $request_uri;
    }
    location /api56/open/common/ {
      proxy_pass http://gatewayservice:10001/open/common/;
      proxy_redirect off;
      proxy_set_header Host $host;
    }
    location /api56/ {
      proxy_pass http://gatewayservice:10001/transfer/manage/;
      proxy_redirect off;
      proxy_set_header Host $host;
    #location ~ .*ping?$ {
    #   return 404;
    #}

    #if ($request_uri ~* ^/\?ping(.*)$) {
    #    return 404;
    #}
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
    #location ~ .*ping?$ {
    #   return 404;
    #}

    #if ($request_uri ~* ^/\?ping(.*)$) {
    #     return 404;
    #}
    }
}
