配置文件

  1. http {
  2. server {
  3. resolver 192.168.31.1;
  4. resolver_timeout 5s;
  5. listen 8888;
  6. access_log /var/log/proxy.access.log;
  7. error_log /var/log/proxy.error.log;
  8. location / {
  9. proxy_pass $scheme://$host$request_uri;
  10. proxy_set_header Host $http_host;
  11. proxy_buffers 256 4k;
  12. proxy_max_temp_file_size 0;
  13. proxy_connect_timeout 30;
  14. proxy_cache_valid 200 302 10m;
  15. proxy_cache_valid 301 1h;
  16. proxy_cache_valid any 1m;
  17. }
  18. }
  19. }

同时支持https