Re: N00b: Forwarding the full request to upstream server

2018-02-05 Thread loopback_proxy
You could just do 

proxy_pass http://192.168.10.34$request_uri 

See this for more
https://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_uri

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?2,278344,278347#msg-278347

___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


Re: N00b: Forwarding the full request to upstream server

2018-02-04 Thread Friscia, Michael
I’m interested in this answer as well but will offer what I’ve done so far.

In your example, the only thing I’ve added are these three lines in the 
location block:
proxy_cache_valid 200 1y;
proxy_cache_bypass 1;
proxy_no_cache 1;

But I am not sure I am doing this correctly because I am running into a 
situation where I don’t think the original request is staying intact.

Other settings that are common to both cache and bypass (also not sure these 
are all correct for bypassing):

proxy_cache_valid any 3m;
proxy_cache_revalidate on;
proxy_cache_use_stale error timeout updating invalid_header http_500 http_502 
http_503 http_504;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_methods GET HEAD;
proxy_cache_key "$scheme$host$request_uri";

proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;

proxy_hide_header X-Accel-Expires;
proxy_hide_header Expires;
proxy_hide_header Cache-Control;
proxy_hide_header Set-Cookie;
proxy_hide_header Pragma;
proxy_hide_header Server;
proxy_hide_header Request-Context;
proxy_hide_header X-Powered-By;
proxy_hide_header X-AspNet-Version;
proxy_hide_header X-AspNetMvc-Version;

proxy_set_header X-Forwarded-Server $hostname;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding identity;

server_tokens off;

___
Michael Friscia
Office of Communications
Yale School of Medicine
(203) 737-7932 - office
(203) 931-5381 - mobile
http://web.yale.edu


From: nginx  on behalf of Joel Parker 

Reply-To: "nginx@nginx.org" 
Date: Sunday, February 4, 2018 at 8:26 PM
To: "nginx@nginx.org" 
Subject: N00b: Forwarding the full request to upstream server

I have a situation where I receive a request like:
http://device.healthcheck.com/ready
I want this to be sent to a server upstream but keep the full request intact. 
For example:

server {
resolver 8.8.8.8;
listen 80;

location / {
// send this too 192.168.10.34
proxy_pass $host:$server_port$uri$is_args$args;
}
}
I know this is probably easy to do but I am not sure how to accomplish this.
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx