SHARE
TWEET

Untitled

a guest May 24th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.     listen       80;
  3.  
  4.     proxy_hide_header header-a;
  5.     proxy_hide_header header-b;
  6.  
  7.     proxy_pass_header header-a;
  8.     proxy_pass_header header-b;
  9.  
  10.        add_header X-Proxy-Cache $upstream_cache_status;
  11.        proxy_cache test;
  12.        proxy_cache_valid 1m;
  13.  
  14. location ~ /component1/ {
  15.        proxy_http_version 1.1;
  16.        proxy_connect_timeout 75s;
  17.        proxy_read_timeout 100s;
  18.        client_max_body_size 100m;
  19.  
  20.        proxy_set_header Host $host;
  21.        proxy_set_header X-Real-IP $remote_addr;
  22.        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  23.        proxy_set_header X-Forwarded-Host $host;
  24.        proxy_set_header X-Forwarded-Port $server_port;
  25.        proxy_set_header X-Forwarded-Proto $scheme;
  26.         if ($request_uri ~* ".(ico|css|js|gif|jpe?g|png)$") {
  27.             expires @14h44m;
  28.      }
  29.        proxy_buffering on;
  30.        proxy_buffers 16 8k;
  31.        proxy_buffer_size 4k;
  32.        proxy_max_temp_file_size 0;
  33.  
  34.  
  35.        proxy_pass http://backend_server_IP:8080$request_uri;
  36.     }
  37.  
  38.  
  39. location ~ /component2/ {
  40.        proxy_http_version 1.1;
  41.        proxy_connect_timeout 75s;
  42.        proxy_read_timeout 100s;
  43.        client_max_body_size 100m;
  44.  
  45.     if ($request_uri ~* ".(ico|css|js|gif|jpe?g|png)$") {
  46.             expires @15h55m;
  47.      }
  48.  
  49.        proxy_set_header Host $host;
  50.        proxy_set_header X-Real-IP $remote_addr;
  51.        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  52.        proxy_set_header X-Forwarded-Host $host;
  53.        proxy_set_header X-Forwarded-Port $server_port;
  54.        proxy_set_header X-Forwarded-Proto $scheme;
  55.  
  56.        proxy_buffering on;
  57.        proxy_buffers 16 8k;
  58.        proxy_buffer_size 4k;
  59.        proxy_max_temp_file_size 0;
  60.  
  61.  
  62.        proxy_pass http://backend_server_IP:8080$request_uri;
  63.     }
  64.  
  65. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top