forked from octoberswimmer/heroku-reverse-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
34 lines (29 loc) · 827 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
worker_processes 2;
error_log /dev/stdout info;
daemon off;
events {
worker_connections 256;
}
http {
proxy_cache_path cacheFolder keys_zone=one:15m;
proxy_cache_methods GET HEAD POST;
proxy_cache one;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 400 15m;
access_log /dev/stdout;
server {
listen ${{PORT}};
location / {
proxy_pass ${{UPSTREAM_SERVER}};
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_headers "Set-Cookie";
proxy_hide_header "Set-Cookie";
}
if ($http_x_forwarded_proto != "https") {
rewrite ^(.*)$ https://$host$1 permanent;
}
}
}