Nginx - Proxy

About

proxy in Nginx

Example

A proxy is defined in a location block

upstream targetService {
    server 127.0.0.1:8080;
    # A keepalive directive sets the maximum number of upstream idle connections that can remain open at any given time (for each Nginx worker process).
    keepalive 64;
}

location / {

	proxy_set_header X-Forwarded-Host $host;
	proxy_set_header X-Forwarded-Server $host;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-Proto "https";
	proxy_pass http://targetService;
	proxy_http_version 1.1;
	proxy_pass_request_headers on;
	proxy_set_header Connection "keep-alive";
	proxy_store off;

}

where:


Powered by ComboStrap