# HG changeset patch # User Ruslan Ermilov # Date 1524812391 -10800 # Node ID 5cacd6fffade97416b2e85da3067a9d8fa6a0112 # Parent e325638a6f341d54657a19160af5c58ef443df8a Eliminated some examples of unsafe prefix locations. diff --git a/xml/en/docs/example.xml b/xml/en/docs/example.xml --- a/xml/en/docs/example.xml +++ b/xml/en/docs/example.xml @@ -8,7 +8,7 @@
+ rev="3">
@@ -116,7 +116,7 @@ http { error_page 404 /404.html; - location /404.html { + location = /404.html { root /spool/www; } diff --git a/xml/en/docs/http/ngx_http_core_module.xml b/xml/en/docs/http/ngx_http_core_module.xml --- a/xml/en/docs/http/ngx_http_core_module.xml +++ b/xml/en/docs/http/ngx_http_core_module.xml @@ -10,7 +10,7 @@ + rev="80">
@@ -864,7 +864,7 @@ Example: error_page 404 /404.html; -location /404.html { +location = /404.html { internal; } diff --git a/xml/en/docs/http/ngx_http_fastcgi_module.xml b/xml/en/docs/http/ngx_http_fastcgi_module.xml --- a/xml/en/docs/http/ngx_http_fastcgi_module.xml +++ b/xml/en/docs/http/ngx_http_fastcgi_module.xml @@ -10,7 +10,7 @@ + rev="50">
@@ -786,7 +786,7 @@ If the string is found th server has returned an invalid response. This allows handling application errors in nginx, for example: -location /php { +location /php/ { fastcgi_pass backend:9000; ... fastcgi_catch_stderr "PHP Fatal error"; diff --git a/xml/en/docs/http/ngx_http_hls_module.xml b/xml/en/docs/http/ngx_http_hls_module.xml --- a/xml/en/docs/http/ngx_http_hls_module.xml +++ b/xml/en/docs/http/ngx_http_hls_module.xml @@ -9,7 +9,7 @@ + rev="7">
@@ -197,11 +197,11 @@ http { server { ... - location /hls { + location /hls/ { hls; hls_forward_args on; - alias /var/videos; + alias /var/videos/; secure_link $arg_md5,$arg_expires; secure_link_md5 "$secure_link_expires$hls_uri$remote_addr secret"; diff --git a/xml/en/docs/http/ngx_http_js_module.xml b/xml/en/docs/http/ngx_http_js_module.xml --- a/xml/en/docs/http/ngx_http_js_module.xml +++ b/xml/en/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ + rev="15">
@@ -50,11 +50,11 @@ http { js_content baz; } - location /summary { + location = /summary { return 200 $summary; } - location /hello { + location = /hello { js_content hello; } } diff --git a/xml/en/docs/http/ngx_http_mirror_module.xml b/xml/en/docs/http/ngx_http_mirror_module.xml --- a/xml/en/docs/http/ngx_http_mirror_module.xml +++ b/xml/en/docs/http/ngx_http_mirror_module.xml @@ -9,7 +9,7 @@ + rev="3">
@@ -32,7 +32,7 @@ location / { proxy_pass http://backend; } -location /mirror { +location = /mirror { internal; proxy_pass http://test_backend$request_uri; } @@ -85,7 +85,7 @@ location / { proxy_pass http://backend; } -location /mirror { +location = /mirror { internal; proxy_pass http://log_backend; proxy_pass_request_body off; diff --git a/xml/en/docs/http/ngx_http_ssi_module.xml b/xml/en/docs/http/ngx_http_ssi_module.xml --- a/xml/en/docs/http/ngx_http_ssi_module.xml +++ b/xml/en/docs/http/ngx_http_ssi_module.xml @@ -10,7 +10,7 @@ + rev="12">
@@ -370,7 +370,7 @@ The maximum size of the response is set directive (1.13.10): -location /remote { +location /remote/ { subrequest_output_buffer_size 64k; ... } diff --git a/xml/en/docs/http/ngx_http_stub_status_module.xml b/xml/en/docs/http/ngx_http_stub_status_module.xml --- a/xml/en/docs/http/ngx_http_stub_status_module.xml +++ b/xml/en/docs/http/ngx_http_stub_status_module.xml @@ -10,7 +10,7 @@ + rev="4">
@@ -32,7 +32,7 @@ configuration parameter. -location /basic_status { +location = /basic_status { stub_status; } diff --git a/xml/ru/docs/example.xml b/xml/ru/docs/example.xml --- a/xml/ru/docs/example.xml +++ b/xml/ru/docs/example.xml @@ -8,7 +8,7 @@
+ rev="3">
@@ -116,7 +116,7 @@ http { error_page 404 /404.html; - location /404.html { + location = /404.html { root /spool/www; } diff --git a/xml/ru/docs/http/ngx_http_core_module.xml b/xml/ru/docs/http/ngx_http_core_module.xml --- a/xml/ru/docs/http/ngx_http_core_module.xml +++ b/xml/ru/docs/http/ngx_http_core_module.xml @@ -10,7 +10,7 @@ + rev="80">
@@ -860,7 +860,7 @@ error_page 404 =301 http://example.com/n error_page 404 /404.html; -location /404.html { +location = /404.html { internal; } diff --git a/xml/ru/docs/http/ngx_http_fastcgi_module.xml b/xml/ru/docs/http/ngx_http_fastcgi_module.xml --- a/xml/ru/docs/http/ngx_http_fastcgi_module.xml +++ b/xml/ru/docs/http/ngx_http_fastcgi_module.xml @@ -10,7 +10,7 @@ + rev="50">
@@ -788,7 +788,7 @@ fastcgi_cache_valid any 1m; вернул неверный ответ. Это позволяет обрабатывать ошибки приложений в nginx, например: -location /php { +location /php/ { fastcgi_pass backend:9000; ... fastcgi_catch_stderr "PHP Fatal error"; diff --git a/xml/ru/docs/http/ngx_http_hls_module.xml b/xml/ru/docs/http/ngx_http_hls_module.xml --- a/xml/ru/docs/http/ngx_http_hls_module.xml +++ b/xml/ru/docs/http/ngx_http_hls_module.xml @@ -9,7 +9,7 @@ + rev="7">
@@ -197,11 +197,11 @@ http { server { ... - location /hls { + location /hls/ { hls; hls_forward_args on; - alias /var/videos; + alias /var/videos/; secure_link $arg_md5,$arg_expires; secure_link_md5 "$secure_link_expires$hls_uri$remote_addr secret"; diff --git a/xml/ru/docs/http/ngx_http_js_module.xml b/xml/ru/docs/http/ngx_http_js_module.xml --- a/xml/ru/docs/http/ngx_http_js_module.xml +++ b/xml/ru/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ + rev="15">
@@ -50,11 +50,11 @@ http { js_content baz; } - location /summary { + location = /summary { return 200 $summary; } - location /hello { + location = /hello { js_content hello; } } diff --git a/xml/ru/docs/http/ngx_http_mirror_module.xml b/xml/ru/docs/http/ngx_http_mirror_module.xml --- a/xml/ru/docs/http/ngx_http_mirror_module.xml +++ b/xml/ru/docs/http/ngx_http_mirror_module.xml @@ -9,7 +9,7 @@ + rev="3">
@@ -32,7 +32,7 @@ location / { proxy_pass http://backend; } -location /mirror { +location = /mirror { internal; proxy_pass http://test_backend$request_uri; } @@ -85,7 +85,7 @@ location / { proxy_pass http://backend; } -location /mirror { +location = /mirror { internal; proxy_pass http://log_backend; proxy_pass_request_body off; diff --git a/xml/ru/docs/http/ngx_http_ssi_module.xml b/xml/ru/docs/http/ngx_http_ssi_module.xml --- a/xml/ru/docs/http/ngx_http_ssi_module.xml +++ b/xml/ru/docs/http/ngx_http_ssi_module.xml @@ -10,7 +10,7 @@ + rev="12">
@@ -374,7 +374,7 @@ SSI, например: (1.13.10): -location /remote { +location /remote/ { subrequest_output_buffer_size 64k; ... } diff --git a/xml/ru/docs/http/ngx_http_stub_status_module.xml b/xml/ru/docs/http/ngx_http_stub_status_module.xml --- a/xml/ru/docs/http/ngx_http_stub_status_module.xml +++ b/xml/ru/docs/http/ngx_http_stub_status_module.xml @@ -10,7 +10,7 @@ + rev="4">
@@ -32,7 +32,7 @@ -location /basic_status { +location = /basic_status { stub_status; }