You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: all.html
+22-1Lines changed: 22 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6082,11 +6082,26 @@ <h3>Apache HTTP Server resources</h3>
6082
6082
</li>
6083
6083
</ul>
6084
6084
<h1>Nginx</h1>
6085
-
<p>Nginx is the
6085
+
<p><a href="https://nginx.org/en/">Nginx</a>, pronounced "engine-X", is the
6086
6086
<a href="http://w3techs.com/technologies/cross/web_server/ranking">second most common web server among the top 100,000 websites</a>. Nginx also functions well as a
6087
6087
reverse proxy to handle requests and pass back responses for Python
6088
6088
<a href="/wsgi-servers.html">WSGI servers</a> or even other web servers such as Apache.</p>
<h2>How is Nginx used in a Python web app deployment?</h2>
6091
+
<p>Nginx is commonly used as a web server to serve static assets such
6092
+
as images, CSS and JavaScript to web browser clients. </p>
6093
+
<p>Nginx is also typically configured as a reverse proxy, which passes
6094
+
appropriate incoming HTTP requests to a <a href="/wsgi-servers.html">WSGI server</a>.
6095
+
The WSGI server produces dynamic content by running Python code. When the
6096
+
WSGI server passes its response, which is often in the HTML, JSON or XML
6097
+
format, the reverse proxy then responds to the client with that result. </p>
6098
+
<p>The request and response cycle with a reverse proxy server and the WSGI
6099
+
server can be seen in the following diagram.</p>
6089
6100
<p><img src="/img/web-servers-map.png" width="100%" alt="Python web application deployments rely on Nginx either as a web server or reverse proxy for WSGI servers." class="technical-diagram" /></p>
6101
+
<p>Typically the client will not know or need to know that a Python web
6102
+
application generated the result. The result could have instead been
6103
+
generated by one or more backend systems written in any programming language,
6104
+
not just Python.</p>
6090
6105
<div class="well see-also">Nginx is an implementation of the <a href="/web-servers.html">web server</a> concept. Learn how these pieces fit together in the <a href="/deployment.html">deployment</a> chapter or view the <a href="/table-of-contents.html">table of contents</a> for all topics.</div>
6091
6106
6092
6107
<h2>Should I use Nginx or the Apache HTTP Server?</h2>
@@ -6136,6 +6151,12 @@ <h2>Securing Nginx</h2>
6136
6151
</li>
6137
6152
</ul>
6138
6153
<h2>General Nginx resources</h2>
6154
+
<p>Nginx can be used without Python so there are a massive number of fantastic
6155
+
resources available for installing, configuring and optimizing this
6156
+
<a href="/web-servers.html">web server</a> implementation. The following resources are
6157
+
ones that I collected during my own struggle while learning how to use
6158
+
Nginx after I had used <a href="/apache-http-server.html">Apache HTTP Server</a> for
6159
+
several years.</p>
6139
6160
<ul>
6140
6161
<li>
6141
6162
<p>The <a href="http://www.aosabook.org/en/nginx.html">Nginx chapter</a> in the
0 commit comments