server { listen 15050; server_name localhost; client_header_buffer_size 128k; large_client_header_buffers 4 128k; location ~ ^/history/(.*)/(.*)/jobs/$ { proxy_pass http://localhost:18080/history/$1/jobs/; proxy_redirect http://localhost:18080/history/$1/jobs/ $domain_name/proxy/15050/history/$1/jobs/; expires off; } location / { proxy_pass http://localhost:18080; expires off; } }