<div>Hey guys </div><div>the following is our current setup on the apps</div><div><br></div><div>but we would like to add nginx as a reverse proxy cache much like squid or varnish</div><div>is it possible to edit this config to enable that caching behavior or do i need to add another nginx in front of this set up like i would do for squid or varnish</div>
<div><br></div><div>if this can be done without resorting to usage of squid and varnish it would be nice to have the complete setup in nginx</div><div><br></div><div><br></div><div><br></div><div>thanks a lot</div><div><br>
</div><div><br></div><div>    upstream backend_appname{</div><div>#<a href="http://start1.someserver.com">start1.someserver.com</a></div><div>         server <a href="http://start1.someserver.com:7810">start1.someserver.com:7810</a> fail_timeout=3s;</div>
<div>         server <a href="http://start1.someserver.com:7811">start1.someserver.com:7811</a> fail_timeout=3s;</div><div>         server <a href="http://start1.someserver.com:7812">start1.someserver.com:7812</a> fail_timeout=3s;</div>
<div>         server <a href="http://start1.someserver.com:7813">start1.someserver.com:7813</a> fail_timeout=3s;</div><div>    </div><div><br></div><div>    }</div><div>    server {</div><div>        server_name  <a href="http://appname.someserver.com">appname.someserver.com</a>;</div>
<div>listen 80;</div><div>        access_log   logs/access_appname.log;</div><div>        #error_log   logs/error_appname.log;</div><div><br></div><div>        location /nginx_status {</div><div>            stub_status on;</div>
<div>            access_log   off;</div><div>        }</div><div><br></div><div>        location /static {</div><div>            root   /home/someuser/work/appname;</div><div>            expires max;</div><div>            add_header Cache-Control public,max-age=604800,post-check=604800,pre-check=1209600;</div>
<div>        }</div><div>        location / {</div><div>            root   /home/someuser/work/appname;</div><div>            fastcgi_pass backend_appname;</div><div>          set  $addr  $remote_addr;</div><div><br></div>
<div>         if ($http_x_forwarded_for ~ &quot;(?:^|,)\s*(\d+\.\d+\.\d+\.\d+)\s*$&quot;) {</div><div>               set  $addr  $1;</div><div>         }</div><div><br></div><div>            fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;</div>
<div>            fastcgi_param PATH_INFO       $fastcgi_script_name;</div><div>            fastcgi_param QUERY_STRING    $query_string;</div><div>            fastcgi_param CONTENT_TYPE    $content_type;</div><div>            fastcgi_param CONTENT_LENGTH  $content_length;</div>
<div>            fastcgi_param REQUEST_METHOD  $request_method;</div><div>            fastcgi_param REMOTE_ADDR     $addr;</div><div>            fastcgi_param REMOTE_PORT     $remote_port;</div><div>            fastcgi_param SERVER_PROTOCOL $server_protocol;</div>
<div>            fastcgi_param SERVER_ADDR     $server_addr;</div><div>            fastcgi_param SERVER_PORT     $server_port;</div><div>            fastcgi_param SERVER_NAME     $server_name;</div><div><br></div><div>        }</div>
<div><br></div><div>    }</div><div><br></div>