-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnginx.conf
More file actions
65 lines (53 loc) · 1.8 KB
/
nginx.conf
File metadata and controls
65 lines (53 loc) · 1.8 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
user nginx nginx;
worker_processes 1;
pid /var/run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
# set to 'on' if worker_processes > 1
accept_mutex off;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 30;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
log_format main '[$time_local] $status REQUEST: "$request" REFERER: "$http_referer" FWD_FOR "$http_x_forwarded_for" PROXY_HOST: "$proxy_host" UPSTREAM_ADDR: "$upstream_addr"';
gzip on;
upstream simplified_server {
# fail_timeout=0 means always retry an upstream even if it failed
# to return a good HTTP response
server 127.0.0.1:8000 fail_timeout=0;
}
server {
listen 80 deferred;
client_max_body_size 4G;
keepalive_timeout 5;
# Static files are served by nginx, with one exception:
# when the app is running locally *without* Docker.
# See app.py to find the routes that serve the
# static files in that scenario.
location ~ ^/static/.*\.(css|js|eot|svg|ttf)$ {
include /etc/nginx/mime.types;
root /simplified_static;
}
location = /favicon.ico {
return 204;
}
location / {
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://simplified_server;
}
}
}