forked from FuzzyGrim/Yamtrack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
62 lines (50 loc) · 1.58 KB
/
nginx.conf
File metadata and controls
62 lines (50 loc) · 1.58 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
user abc;
worker_processes auto;
pid /tmp/nginx.pid;
error_log /dev/stderr warn;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout combined;
sendfile on;
tcp_nodelay on;
keepalive_timeout 65;
client_max_body_size 20M;
client_body_buffer_size 256k;
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
upstream app_server {
server 127.0.0.1:8001;
}
server {
listen 8000;
server_name _;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
# Proxy to Gunicorn
location / {
proxy_pass http://app_server;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}
location /health/ {
access_log off;
proxy_pass http://app_server;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}
# Static files
location /static/ {
alias /yamtrack/staticfiles/;
expires 30d;
add_header Cache-Control "public";
}
}
}