Skip to content

Instantly share code, notes, and snippets.

@fire9
Last active December 21, 2017 12:19
Show Gist options
  • Save fire9/02daf24dcc1988a8f2bd713c7c890d89 to your computer and use it in GitHub Desktop.
Save fire9/02daf24dcc1988a8f2bd713c7c890d89 to your computer and use it in GitHub Desktop.
proxy forward direction for nginx
server {
resolver 8.8.8.8;
resolver_timeout 5s;
listen 8080;
access_log /var/logs/nginx/proxy.access.log;
error_log /var/logs/nginx/proxy.error.log;
location / {
proxy_pass $scheme://$host$request_uri;
proxy_set_header Host $http_host;
proxy_buffers 256 4k;
proxy_max_temp_file_size 0;
proxy_connect_timeout 30;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 301 1h;
proxy_cache_valid any 1m;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment