<div></div>Hi,<div>I am using nginx as reverse proxy cache with Apache.</div><div><br></div><div>Basically I use this configuration:</div><div><br></div><div>https://www.djm.org.uk/wordpress-nginx-reverse-proxy-caching-setup/<br></div><div><br></div><div>I need to exclude a specific virtual from nginx's cache.</div><div><br></div><div><br></div><div>So I added "shop" upstream with this configuration:</div><div><br></div><div><div>upstream backend {</div><div>        ip_hash;</div><div>        server 127.0.0.1:8080; # IP goes here.</div><div>    }</div><div>upstream shop {</div><div>        ip_hash;</div><div>        server 127.0.0.1:8081; # IP goes here.</div><div>    }</div><div>server {</div><div>        listen 1.1.1.1; # IP goes here.</div><div>        server_name virtual_host_without_cache.domain.org;</div><div>        location / {</div><div>            proxy_pass http://shop;</div><div>        }</div><div>        real_ip_header X-Forwarded-For;</div><div><br></div><div>        # Set proxy headers for the passthrough</div><div>        proxy_set_header Host $host;</div><div>        proxy_set_header X-Real-IP $remote_addr;</div><div>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>        #proxy_set_header X-Forwarded-For $remote_addr;</div><div>}</div><div><br></div><div>server {</div><div>        listen 1.1.1.1:80; # IP goes here.</div><div>        server_name virtual_host_WITH_cache.domain.org; # IP could go here.</div></div><div>...</div><div>...</div><div>....</div><div><br></div><div><br></div><div>Is it correct way to do this?</div><div>I am still getting in http request header regarding caching when I get pages from  virtual_host_without_cache.domain.org:</div><div><br></div><div><p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">HTTP/1.1 200 OK</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Server: nginx/1.8.1</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Date: Mon, 11 Apr 2016 11:00:59 GMT</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Content-Type: image/jpeg</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Content-Length: 65721</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Connection: keep-alive</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Last-Modified: Thu, 21 Jan 2016 16:59:08 GMT</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">ETag: "38292e-100b9-529db055b4f00"</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Accept-Ranges: bytes</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Expires: Tue, 12 Apr 2016 11:00:59 GMT</span></p>
<p style="margin: 0px;"><span style=" font-family:'Consolas'; font-size:10pt; color:#00007f; background-color:#ededfb;">Cache-Control: max-age=86400</span></p></div><div><br></div><div><br></div><div><div># nginx -v</div><div>nginx version: nginx/1.8.1</div></div><div><br></div><div><div># cat /etc/redhat-release </div><div>CentOS release 6.7 (Final)</div></div><div><br></div><div><div># httpd -v</div><div>Server version: Apache/2.2.15 (Unix)</div><div>Server built:   Mar 22 2016 19:03:53</div></div><div><br></div><div>Thank you</div><div><br></div><div><br></div><div><br></div><div><br></div>