Skip to content

Instantly share code, notes, and snippets.

@holysugar
Last active December 14, 2015 20:09
Show Gist options
  • Select an option

  • Save holysugar/5141710 to your computer and use it in GitHub Desktop.

Select an option

Save holysugar/5141710 to your computer and use it in GitHub Desktop.
/etc/nginx/conf.d/proxy-5t125.conf
upstream growthforecast {
server 127.0.0.1:5125;
}
log_format ltsv 'time:$time_local\t'
'host:$remote_addr\t'
'request:$request\t'
'status:$status\t'
'size:$body_bytes_sent\t'
'referer:$http_referer\t'
'ua:$http_user_agent\t'
'reqtime:$request_time\t'
'upsttime:$upstream_response_time';
server {
listen 80 default_server;
server_name YOURSERVERNAME;
access_log /var/log/nginx/access.log ltsv;
error_log /var/log/nginx/error.log warn;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
proxy_pass http://growthforecast;
#proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment