Access API error 404 page not found

I am using google cloude instance (OS : Ubuntu 16.04.1 LTS) and deployed tyk-dashbord, pump, tyk-gateway, mongo and redis on same instance. I have configure API through tyk-dashbord
I am getting error “404 page not found” when i tried to access API through curl.
curl output:
root@instance-1:/opt/tyk-dashboard# curl -v -H “Authorization: 8ff779b2cb91443844a086cd1312235f” -s http://localhost:8080/ping-api/

  • Trying 127.0.0.1…
  • Connected to localhost (127.0.0.1) port 8080 (#0)

GET /ping-api/ HTTP/1.1
Host: localhost:8080
User-Agent: curl/7.47.0
Accept: /
Authorization: 8ff779b2cb91443844a086cd1312235f

< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 17 Oct 2019 08:18:50 GMT
< Content-Length: 19
<
404 page not found

  • Connection #0 to host localhost left intact
    root@instance-1:/opt/tyk-dashboard#

I am new here and I don’t know what went wrong.

tyk_analytics.conf
root@instance-1:/opt/tyk-dashboard# cat tyk_analytics.conf
{
“listen_port”: 3000,
“tyk_api_config”: {
“Host”: “localhost”,
“Port”: “8080”,
“Secret”: “352d20ee67be67f6340b4c0605b044b7”
},
“enable_ownership”: false,
“mongo_url”: “mongodb://localhost/tyk_analytics”,
“mongo_use_ssl”: false,
“mongo_ssl_insecure_skip_verify”: false,
“mongo_session_consistency”: “strong”,
“page_size”: 10,
“admin_secret”: “12345”,
“shared_node_secret”: “352d20ee67be67f6340b4c0605b044b7”,
“redis_port”: 6379,
“redis_host”: “localhost”,
“redis_password”: “”,
“redis_timeout”: 0,
“redis_database”: 0,
“enable_cluster”: false,
“redis_use_ssl”: false,
“redis_ssl_insecure_skip_verify”: false,
“force_api_defaults”: false,
“notify_on_change”: true,
“license_key”: “#My_license_key”,
“redis_hosts”: null,
“hash_keys”: true,
“email_backend”: {
“enable_email_notifications”: false,
“code”: “”,
“settings”: null,
“default_from_email”: “”,
“default_from_name”: “”,
“dashboard_hostname”: “”
},
“hide_listen_path”: false,
“sentry_code”: “”,
“sentry_js_code”: “”,
“use_sentry”: false,
“enable_master_keys”: false,
“enable_duplicate_slugs”: true,
“show_org_id”: true,
“host_config”: {
“enable_host_names”: true,
“disable_org_slug_prefix”: true,
“hostname”: “34.93.173.104”,
“override_hostname”: “34.93.173.104”,
“portal_domains”: {},
“portal_root_path”: “/portal”,
“generate_secure_paths”: false,
“secure_cookies”: false,
“use_strict_hostmatch”: false
},
“http_server_options”: {
“use_ssl”: false,
“certificates”: [
{
“domain_name”: “”,
“cert_file”: “”,
“key_file”: “”
}
],
“min_version”: 0,
“ssl_ciphers”: null,
“ssl_insecure_skip_verify”: false,
“prefer_server_ciphers”: false
},
“security”: {
“allow_admin_reset_password”: false,
“login_failure_username_limit”: 0,
“login_failure_ip_limit”: 0,
“login_failure_expiration”: 0,
“login_disallow_forward_proxy”: false,
“audit_log_path”: “”,
“user_password_max_days”: 0,
“enforce_password_history”: 0,
“force_first_login_pw_reset”: false,
“enable_content_security_policy”: false,
“allowed_content_sources”: “”
},
“ui”: {
“languages”: {
“Chinese”: “cn”,
“English”: “en”,
“French”: “fr”,
“Korean”: “ko”
},
“hide_help”: false,
“default_lang”: “en”,
“login_page”: {},
“nav”: {},
“uptime”: {},
“portal_section”: null,
“designer”: {},
“dont_show_admin_sockets”: false,
“dont_allow_license_management”: false,
“dont_allow_license_management_view”: false,
“cloud”: false
},
“home_dir”: “/opt/tyk-dashboard”,
“identity_broker”: {
“enabled”: false,
“host”: {
“connection_string”: “localhost:3010”,
“secret”: “934893845123491238192381486djfhr87234827348”
}
},
“tagging_options”: {
“tag_all_apis_by_org”: false
},
“use_sharded_analytics”: false,
“enable_aggregate_lookups”: true,
“enable_analytics_cache”: false,
“aggregate_lookup_cutoff”: “01/07/2016”,
“maintenance_mode”: false,
“allow_explicit_policy_id”: false,
“private_key_path”: “”,
“node_schema_path”: “”,
“oauth_redirect_uri_separator”: “;”,
“statsd_connection_string”: “”,
“statsd_prefix”: “”,
“disable_parallel_sessions”: false,
“dashboard_session_lifetime”: 0,
“alternative_dashboard_url”: “”,
“sso_permission_defaults”: null,
“sso_default_group_id”: “”,
“sso_custom_login_url”: “”,
“sso_custom_portal_login_url”: “”,
“sso_enable_user_lookup”: false,
“notifications_listen_port”: 5000,
“portal_session_lifetime”: 0,
“enable_delete_key_by_hash”: false,
“enable_update_key_by_hash”: false,
“audit”: {
“enabled”: false,
“format”: “”,
“path”: “”,
“detailed_recording”: false
},
“enable_multi_org_users”: false,
“version_check_url”: “”
}
root@instance-1:/opt/tyk-dashboard#

tyc.conf :
root@instance-1:/opt/tyk-dashboard# cat …/tyk-gateway/tyk.conf
{
“listen_port”: 8080,
“secret”: “352d20ee67be67f6340b4c0605b044b7”,
“template_path”: “/opt/tyk-gateway/templates”,
“node_secret” : “352d20ee67be67f6340b4c0605b044b7”,
“use_db_app_configs”: false,
“app_path”: “/opt/tyk-gateway/apps”,
“middleware_path”: “/opt/tyk-gateway/middleware”,
“storage”: {
“type”: “redis”,
“host”: “localhost”,
“port”: 6379,
“username”: “”,
“password”: “”,
“database”: 0,
“optimisation_max_idle”: 2000,
“optimisation_max_active”: 4000
},
“enable_analytics”: false,
“analytics_config”: {
“type”: “”,
“ignored_ips”: ,
“normalise_urls”: {
“enabled”: true,
“normalise_uuids”: true,
“normalise_numbers”: true,
“custom_patterns”:
}
},
“health_check”: {
“enable_health_checks”: true,
“health_check_value_timeouts”: 60
},
“dns_cache”: {
“enabled”: false,
“ttl”: 3600
},
“optimisations_use_async_session_write”: true,
“allow_master_keys”: false,
“policies”: {
“policy_source”: “file”,
“policy_record_name”: “policies/policies.json”
},
“hash_keys”: true,
“suppress_redis_signal_reload”: false,
“close_connections”: false,
“enable_non_transactional_rate_limiter”: true,
“enable_sentinel_rate_limiter”: false,
“local_session_cache”: {
“disable_cached_session_state”: false
},
“uptime_tests”: {
“disable”: false,
“config”: {
“enable_uptime_analytics”: false,
“failure_trigger_sample_size”: 2,
“time_wait”: 10,
“checker_pool_size”: 50
}
},
“http_server_options”: {
“enable_http2”: true,
“enable_websockets”: true
},
“hostname”: “”,
“enable_custom_domains”: true,
“proxy_enable_http2”: true,
“enable_jsvm”: true,
“oauth_redirect_uri_separator”: “;”,
“coprocess_options”: {
“enable_coprocess”: false,
“coprocess_grpc_server”: “”,
“python_path_prefix”: “/opt/tyk-gateway”
},
“pid_file_location”: “./tyk-gateway.pid”,
“allow_insecure_configs”: true,
“public_key_path”: “”,
“close_idle_connections”: false,
“allow_remote_config”: false,
“enable_bundle_downloader”: true,
“bundle_base_url”: “”,
“global_session_lifetime”: 100,
“force_global_session_lifetime”: false,
“max_idle_connections_per_host”: 500
}
root@instance-1:/opt/tyk-dashboard#

IP:3000/api/apis/
{
“apis”: [
{
“created_at”: “2019-10-17T07:43:05Z”,
“api_model”: {},
“api_definition”: {
“id”: “5da81b89d4fdab06840dcdf2”,
“name”: “ping-api”,
“slug”: “ping-api”,
“listen_port”: 80,
“protocol”: “http”,
“enable_proxy_protocol”: false,
“api_id”: “593df7e61fe84c836ce767633a37d820”,
“org_id”: “5da5996fd4fdab1b9125ba50”,
“use_keyless”: false,
“use_oauth2”: false,
“use_openid”: false,
“openid_options”: {
“providers”: ,
“segregate_by_client”: false
},
“oauth_meta”: {
“allowed_access_types”: ,
“allowed_authorize_types”: ,
“auth_login_redirect”: “”
},
“auth”: {
“use_param”: false,
“param_name”: “”,
“use_cookie”: false,
“cookie_name”: “”,
“auth_header_name”: “Authorization”,
“use_certificate”: false,
“validate_signature”: false,
“signature”: {
“algorithm”: “”,
“header”: “”,
“secret”: “”,
“allowed_clock_skew”: 0,
“error_code”: 0,
“error_message”: “”
}
},
“use_basic_auth”: false,
“basic_auth”: {
“disable_caching”: false,
“cache_ttl”: 0,
“extract_from_body”: false,
“body_user_regexp”: “”,
“body_password_regexp”: “”
},
“use_mutual_tls_auth”: false,
“client_certificates”: ,
“upstream_certificates”: {},
“pinned_public_keys”: {},
“enable_jwt”: false,
“use_standard_auth”: true,
“use_go_plugin_auth”: false,
“enable_coprocess_auth”: false,
“jwt_signing_method”: “”,
“jwt_source”: “”,
“jwt_identity_base_field”: “”,
“jwt_client_base_field”: “”,
“jwt_policy_field_name”: “”,
“jwt_default_policies”: ,
“jwt_issued_at_validation_skew”: 0,
“jwt_expires_at_validation_skew”: 0,
“jwt_not_before_validation_skew”: 0,
“jwt_skip_kid”: false,
“jwt_scope_to_policy_mapping”: {},
“jwt_scope_claim_name”: “”,
“notifications”: {
“shared_secret”: “”,
“oauth_on_keychange_url”: “”
},
“enable_signature_checking”: false,
“hmac_allowed_clock_skew”: -1,
“hmac_allowed_algorithms”: ,
“request_signing”: {
“is_enabled”: false,
“secret”: “”,
“key_id”: “”,
“algorithm”: “”
},
“base_identity_provided_by”: “”,
“definition”: {
“location”: “header”,
“key”: “x-api-version”,
“strip_path”: false
},
“version_data”: {
“not_versioned”: true,
“default_version”: “”,
“versions”: {
“Default”: {
“name”: “Default”,
“expires”: “”,
“paths”: {
“ignored”: ,
“white_list”: ,
“black_list”:
},
“use_extended_paths”: true,
“extended_paths”: {},
“global_headers”: {},
“global_headers_remove”: ,
“global_size_limit”: 0,
“override_target”: “”
}
}
},
“uptime_tests”: {
“check_list”: ,
“config”: {
“expire_utime_after”: 0,
“service_discovery”: {
“use_discovery_service”: false,
“query_endpoint”: “”,
“use_nested_query”: false,
“parent_data_path”: “”,
“data_path”: “”,
“port_data_path”: “”,
“target_path”: “”,
“use_target_list”: false,
“cache_timeout”: 60,
“endpoint_returns_list”: false
},
“recheck_wait”: 0
}
},
“proxy”: {
“preserve_host_header”: false,
“listen_path”: “/ping-api/”,
“target_url”: “http://localhost:9001/tyk/ping”,
“disable_strip_slash”: false,
“strip_listen_path”: true,
“enable_load_balancing”: false,
“target_list”: ,
“check_host_against_uptime_tests”: false,
“service_discovery”: {
“use_discovery_service”: false,
“query_endpoint”: “”,
“use_nested_query”: false,
“parent_data_path”: “”,
“data_path”: “”,
“port_data_path”: “”,
“target_path”: “”,
“use_target_list”: false,
“cache_timeout”: 0,
“endpoint_returns_list”: false
},
“transport”: {
“ssl_insecure_skip_verify”: false,
“ssl_ciphers”: ,
“ssl_min_version”: 0,
“proxy_url”: “”
}
},
“disable_rate_limit”: false,
“disable_quota”: false,
“custom_middleware”: {
“pre”: ,
“post”: ,
“post_key_auth”: ,
“auth_check”: {
“name”: “”,
“path”: “”,
“require_session”: false,
“raw_body_only”: false
},
“response”: ,
“driver”: “”,
“id_extractor”: {
“extract_from”: “”,
“extract_with”: “”,
“extractor_config”: {}
}
},
“custom_middleware_bundle”: “”,
“cache_options”: {
“cache_timeout”: 60,
“enable_cache”: true,
“cache_all_safe_requests”: false,
“cache_response_codes”: ,
“enable_upstream_cache_control”: false,
“cache_control_ttl_header”: “”
},
“session_lifetime”: 0,
“active”: true,
“internal”: false,
“auth_provider”: {
“name”: “”,
“storage_engine”: “”,
“meta”: {}
},
“session_provider”: {
“name”: “”,
“storage_engine”: “”,
“meta”: {}
},
“event_handlers”: {
“events”: {}
},
“enable_batch_request_support”: false,
“enable_ip_whitelisting”: false,
“allowed_ips”: ,
“enable_ip_blacklisting”: false,
“blacklisted_ips”: ,
“dont_set_quota_on_create”: false,
“expire_analytics_after”: 0,
“response_processors”: ,
“CORS”: {
“enable”: false,
“allowed_origins”: ,
“allowed_methods”: ,
“allowed_headers”: ,
“exposed_headers”: ,
“allow_credentials”: false,
“max_age”: 24,
“options_passthrough”: false,
“debug”: false
},
“domain”: “tyk.custome.domain”,
“certificates”: ,
“do_not_track”: false,
“tags”: ,
“enable_context_vars”: false,
“config_data”: {},
“tag_headers”: ,
“global_rate_limit”: {
“rate”: 0,
“per”: 0
},
“strip_auth_data”: false
},
“hook_references”: ,
“is_site”: false,
“sort_by”: 0,
“user_group_owners”: ,
“user_owners”:
}
],
“pages”: 0
}

Kindly help here to identify what I did wrong?
thanks in advance.

I understand this may be a very late reply, but I have linked steps to troubleshoot 404 errors on the gateway in this topic Unable to access my API

From the looks of things, db_app_conf_options seems to be missing from your gateway config file. I also notice a bunch of audit issue with your API definition:

  • listen_port of your API definition is set 80 and not the same as the gateway’s 8080 (i.e. setting listen_port=0 will use the default value from the gateway).
  • domain of your API definition is set to listen on a custom domain and not the host of the gateway