From my understanding of nginx docs, locations can't be nested (or rather if they are the effects aren't inheritable) and proxy_pass can't belong at the server {} level. So my configuration at the moment is like this, I know I can alleviate some by using filepaths but let's pretend I want different cache headers on different paths whilst using proxy_pass. Presumably there is a better way to write this without the repition:
server {
listen 80;
server_name salessystem.acmecorp.com;
location /extjs/ {
## proxy_buffers 128 256k;
proxy_pass http://localhost:5400/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'X-UA-Compatible' 'IE=Edge;chrome=1';
expires max;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 7;
gzip_proxied any;
gzip_types text/html text/css text/pdf application/json application/x-javascript text/javascript;
access_log off;
break;
}
location / {
## proxy_buffers 128 256k;
proxy_pass http://localhost:5400/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'X-UA-Compatible' 'IE=Edge;chrome=1';
expires epoch;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 7;
gzip_proxied any;
gzip_types text/html text/css text/pdf application/json application/x-javascript text/javascript;
access_log off;
break;
}
}