O'Reilly logo

NGINX High Performance by Rahul Sharma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring NGINX Proxy

In the preceding section, we developed a Python application running on the 5000 port. Now, we want to configure NGINX to Proxy the server using the following directives. We will also try to cache the response from the Python server by enabling the proxy cache.

In addition to the directives, the NGINX Proxy module also creates the $proxy_host, $proxy_port, and $proxy_add_x_forward_for variables that can be used at various places such as Proxy headers.

proxy_pass

This directive can be used to specify the protocol, address, and URL (optional) of the upstream server. The protocol takes the value http or https. The address can be in any of the following forms:

  • It can be a domain name or IP address along with the port, that is, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required