-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
65 lines (51 loc) · 1.53 KB
/
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
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
worker_processes 2;
user nobody nogroup;
error_log /var/log/error.log info;
pid /tmp/nginx.pid;
events {
worker_connections 1000;
accept_mutex on;
}
http {
include mime.types;
default_type application/octet-stream;
access_log /var/log/access.log combined gzip flush=5m;
sendfile on;
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
upstream app_server {
server webapp:5000 fail_timeout=0;
}
# server {
# # if no Host match, close the connection to prevent host spoofing
# listen 80 default_server;
# return 444;
# }
server {
listen 80 deferred;
client_max_body_size 1G;
# set the correct host(s) for your site
server_name hope.ru;
keepalive_timeout 5;
# path for static files
root /static/;
location / {
# checks for static file, if not found proxy to app
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://webapp:5000;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /static/;
}
}
}