1
0

reverse_proxy.conf.j2 840 B

1234567891011121314151617181920212223242526272829303132333435
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. server_name {{item.server_name}};
  5. keepalive_timeout 200;
  6. {{item.custom_config | default('') | indent(2)}}
  7. location / {
  8. proxy_pass {{item.proxy_pass}};
  9. # set host
  10. proxy_set_header Host $host;
  11. proxy_set_header X-Forwarded-For 42.42.42.42;
  12. proxy_set_header X-Forwarded-Proto $scheme;
  13. proxy_set_header X-Forwarded-Host $host;
  14. proxy_set_header X-Forwarded-Port $server_port;
  15. # websocket proxy
  16. proxy_http_version 1.1;
  17. proxy_set_header Upgrade $http_upgrade;
  18. proxy_set_header Connection "upgrade";
  19. # compression
  20. gzip on;
  21. gzip_types text/plain application/xml application/json;
  22. gzip_proxied no-cache no-store private expired auth;
  23. gzip_min_length 1000;
  24. # cache
  25. proxy_cache STATIC;
  26. }
  27. }