-
Notifications
You must be signed in to change notification settings - Fork 7
/
nginx.conf
39 lines (35 loc) · 1.19 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
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
# this needs to be an absolute path, adjust accordingly
ssl_certificate /home/ubuntu/ScrapeBot/certs/cert.pem;
ssl_certificate_key /home/ubuntu/ScrapeBot/certs/key.pem;
# write access and error logs to /var/log
access_log /var/log/scrapebot_web_access.log;
error_log /var/log/scrapebot_web_error.log;
location / {
# forward application requests to the gunicorn server
proxy_pass http://localhost:8000;
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
# this needs to be an absolute path, adjust accordingly
alias /home/ubuntu/ScrapeBot/web/static;
expires 30d;
}
}