Skip to Content
Nginx HTTP Server - Fourth Edition
book

Nginx HTTP Server - Fourth Edition

by Martin Bjerretoft Fjordvald, Nedelcu
February 2018
Beginner to intermediate
348 pages
9h 40m
English
Packt Publishing
Content preview from Nginx HTTP Server - Fourth Edition

Main directives

The first set of directives will allow you to establish a basic configuration such as the location of the backend server, information to be passed, and how it should be passed:

Directive

Description

proxy_pass

Context: locationif

Specifies that the request should be forwarded to the backend server by indicating its location:

  • For regular HTTP forwarding, the syntax is proxy_pass http://hostname:port;
  • For Unix domain sockets, the syntax is proxy_pass http://unix:/path/to/file.socket;
  • You may also refer to upstream blocks proxy_pass http://myblock;
  • Instead of http://, you can use https:// for secure traffic. Additional URI parts as well as the use of variables are allowed.

Examples:

  • proxy_pass http://localhost:8080; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Nginx: From Beginner to Pro

Nginx: From Beginner to Pro

Rahul Soni
Nginx Essentials

Nginx Essentials

Valery Kholodkov, Valery I Kholodkov
SSH, The Secure Shell: The Definitive Guide, 2nd Edition

SSH, The Secure Shell: The Definitive Guide, 2nd Edition

Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes

Publisher Resources

ISBN: 9781788623551Other