-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx_config.txt
37 lines (33 loc) · 968 Bytes
/
nginx_config.txt
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
server {
# listen on port 80 (http)
listen 80;
server_name _;
location / {
# redirect any requests to the same URL but on https
return 301 https://$host$request_uri;
}
}
server {
# listen on port 443 (https)
listen 443 ssl;
server_name _;
# location of the self-signed SSL certificate
ssl_certificate /etc/letsencrypt/live/govstat.us/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/govstat.us/privkey.pem;
# write access and error logs to /var/log
access_log /var/log/govstat_access.log;
error_log /var/log/govstat_error.log;
location / {
# forward application requests to the gunicorn server
proxy_pass http://localhost:5000;
proxy_redirect 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;
}
location /static {
# handle static files directly, without forwarding to the application
alias /path/to/govstat/app/static;
expires 5d;
}
}