-
Notifications
You must be signed in to change notification settings - Fork 0
/
odoo-ssl
68 lines (53 loc) · 1.66 KB
/
odoo-ssl
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
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
server {
listen 80;
server_name jeanphy.online;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443;
server_name jeanphy.online;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# SSL Configuration
ssl on;
ssl_certificate /etc/letsencrypt/live/jeanphy.online/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/jeanphy.online/privkey.pem;
ssl_session_timeout 30m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384";
ssl_prefer_server_ciphers on;
# Add log files
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
# enable gzip
gzip on;
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
# Add Headers
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# Manage longpolling on 8072 port
location /longpolling {
proxy_pass http://odoochat;
}
# Redirect requests to odoo server on 8069
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
# Enable static cache
location ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
}
}