events { # determines how many requests can simultaneously be served # https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration # for more information worker_connections 2048; } http { server { # configures the server to listen to the port 8080 # Amazon SageMaker sends inference requests to port 8080. # For more information: https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-code-container-response listen 8080 deferred; # redirects requests from SageMaker to TF Serving location /invocations { proxy_pass http://localhost:8501/v1/models/cifar10_model:predict; } # Used by SageMaker to confirm if server is alive. # https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-algo-ping-requests location /ping { return 200 "OK"; } } }