Proxy
--- proxy
desc: Transfers request to another server context: location
proxy_pass
-
source: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass
-
synopsis: proxy_pass
-
desc: Sets the address of the proxied server and the URI to which location will be mapped
-
eg:
proxy_pass http://localhost:8000/uri/
desc: Redefine headers sent to proxy eg: l
## headers unchanged
proxy_set_header Host $http_host;
]
proxy_redirect [ default | off | eg: |
## request to localhost:8000/two/foo -> frontend/one/foo
proxy_redirect http://localhost:8000/two/ http://frontend/one;
Cook
Basics
location / {
proxy_pass http://localhost:8000;
proxy_set_header X-Real-IP $remote_addr;
}