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: content/nginx/admin-guide/web-server/web-server.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Each virtual server for HTTP traffic defines special configuration instances cal
19
19
20
20
21
21
<spanid="virtual-server"></span>
22
-
## Setting Up Virtual Servers
22
+
## Set Up Virtual Servers
23
23
24
24
The NGINX Plus configuration file must include at least one [server](https://nginx.org/en/docs/http/ngx_http_core_module.html#server) directive to define a virtual server. When NGINX Plus processes a request, it first selects the virtual server that will serve the request.
25
25
@@ -76,7 +76,7 @@ server {
76
76
77
77
78
78
<spanid="locations"></span>
79
-
## Configuring Locations
79
+
## Configure Locations
80
80
81
81
NGINX Plus can send traffic to different proxies or serve different files based on the request URIs. These blocks are defined using the [location](https://nginx.org/en/docs/http/ngx_http_core_module.html#location) directive placed within a `server` directive.
82
82
@@ -148,15 +148,15 @@ The [proxy_pass](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy
148
148
149
149
150
150
<spanid="variables"></span>
151
-
## Using Variables
151
+
## Use Variables
152
152
153
153
You can use variables in the configuration file to have NGINX Plus process requests differently depending on defined circumstances. Variables are named values that are calculated at runtime and are used as parameters to directives. A variable is denoted by the `$` (dollar) sign at the beginning of its name. Variables define information based upon NGINX’s state, such as the properties of the request being currently processed.
154
154
155
155
There are a number of predefined variables, such as the [core HTTP](https://nginx.org/en/docs/http/ngx_http_core_module.html#variables) variables, and you can define custom variables using the [set](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#set), [map](https://nginx.org/en/docs/http/ngx_http_map_module.html#map), and [geo](https://nginx.org/en/docs/http/ngx_http_geo_module.html#geo) directives. Most variables are computed at runtime and contain information related to a specific request. For example, `$remote_addr` contains the client IP address and `$uri` holds the current URI value.
156
156
157
157
158
158
<spanid="return-codes"></span>
159
-
## Returning Specific Status Codes
159
+
## Return Specific Status Codes
160
160
161
161
Some website URIs require immediate return of a response with a specific error or redirect code, for example when a page has been moved temporarily or permanently. The easiest way to do this is to use the [return](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return) directive. For example:
162
162
@@ -180,7 +180,7 @@ The `return` directive can be included in both the `location` and `server` conte
180
180
181
181
182
182
<spanid="rewrite"></span>
183
-
## Rewriting URIs in Requests
183
+
## Rewrite URIs in Requests
184
184
185
185
A request URI can be modified multiple times during request processing through the use of the [rewrite](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) directive, which has one optional and two required parameters. The first (required) parameter is the regular expression that the request URI must match. The second parameter is the URI to substitute for the matching URI. The optional third parameter is a flag that can halt processing of further `rewrite` directives or send a redirect (code `301` or `302`). For example:
186
186
@@ -217,7 +217,7 @@ There are two parameters that interrupt processing of `rewrite` directives:
217
217
218
218
219
219
<spanid="sub_filter"></span>
220
-
## Rewriting HTTP Responses
220
+
## Rewrite HTTP Responses
221
221
222
222
Sometimes you need to rewrite or change the content in an HTTP response, substituting one string for another. You can use the [sub_filter](https://nginx.org/en/docs/http/ngx_http_sub_module.html#sub_filter) directive to define the rewrite to apply. The directive supports variables and chains of substitutions, making more complex changes possible.
223
223
@@ -244,7 +244,7 @@ Note that the part of the response already modified with the `sub_filter` is not
244
244
245
245
246
246
<spanid="errors"></span>
247
-
## Handling Errors
247
+
## Handle Errors
248
248
249
249
With the [error_page](https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page) directive, you can configure NGINX Plus to return a custom page along with an error code, substitute a different error code in the response, or redirect the browser to a different URI. In the following example, the `error_page` directive specifies the page (**/404.html**) to return with the `404` error code.
0 commit comments