-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
75 lines (56 loc) · 1.76 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
66
67
68
69
70
71
72
73
74
75
worker_processes 3;
user nobody nogroup;
error_log /var/log/nginx/error.log warn;
events {
worker_connections 1024; # increase if you have lots of clients
}
http {
include mime.types;
# fallback in case we can't determine a type
default_type application/octet-stream;
access_log /var/log/nginx/access.log combined;
sendfile on;
proxy_connect_timeout 50000;
proxy_send_timeout 50000;
proxy_read_timeout 50000;
fastcgi_connect_timeout 50000;
fastcgi_send_timeout 50000;
fastcgi_read_timeout 50000;
upstream app_server {
# for a TCP configuration
server 127.0.0.1:8000;
}
server {
server_name pythonasalifestyle.ml;
# set the correct host(s) for your site
location / {
try_files $uri @proxy_to_app;
}
location /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/obiohakelvin96/TwitterAnalysis;
}
location /templates/ {
root /home/obiohakelvin96/TwitterAnalysis;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
# we don't want nginx trying to do something clever with
# redirects, we set the Host: header above already.
proxy_pass http://app_server;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/pythonasalifestyle.ml/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/pythonasalifestyle.ml/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = pythonasalifestyle.ml) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name pythonasalifestyle.ml;
return 404; # managed by Certbot
}}