Skip to content

Instantly share code, notes, and snippets.

@leehanchung
Created December 20, 2019 23:56
Show Gist options
  • Save leehanchung/a5ea3ceb709282970ff8dc70f2072fb9 to your computer and use it in GitHub Desktop.
Save leehanchung/a5ea3ceb709282970ff8dc70f2072fb9 to your computer and use it in GitHub Desktop.
NGINX configuration file for Tensorflow Serving Docker image on AWS Sagemaker
events {
# determines how many requests can simultaneously be served
worker_connections 2048;
}
http {
server {
# Increase JSON POST payload to bypass 413 Client Error: Request Entity Too Large for URL
client_max_body_size 100M;
# Sagemaker listens to 8080 port and requires /invocations and /ping endpoints
listen 8080 deferred;
# redirects requests from SageMaker to TF Serving
location /invocations {
proxy_pass http://localhost:8501/v1/models/<<model name here>>>:predict;
}
location /ping {
return 200 "OK";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment