-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
100 lines (85 loc) · 2.97 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#odoo server
upstream odoo {
server odoo:8069;
}
upstream odoochat {
server odoo:8072;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# http -> https
# server {
# listen 80;
# server_name odoo.com;
# rewrite ^(.*) https://$host$1 permanent;
# }
server {
# listen 443 ssl;
# server_name odoo.mycompany.com;
listen 80;
server_name localhost;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# SSL parameters
# ssl_certificate /etc/ssl/nginx/server.crt;
# ssl_certificate_key /etc/ssl/nginx/server.key;
# ssl_session_timeout 30m;
# ssl_protocols TLSv1.2;
# ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
# ssl_prefer_server_ciphers off;
# log
# access_log /var/log/nginx/odoo.access.log;
# error_log /var/log/nginx/odoo.error.log;
# Redirect longpoll requests to odoo longpolling port
# location /longpolling {
# proxy_pass http://odoochat;
# }
# Redirect websocket requests to odoo gevent port
location /websocket {
proxy_pass http://odoochat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $http_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;
# add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
# proxy_cookie_flags session_id samesite=lax secure; # requires nginx 1.19.8
}
# Redirect requests to odoo backend server
location / {
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $http_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;
proxy_redirect off;
proxy_pass http://odoo;
client_max_body_size 100m;
# add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
# proxy_cookie_flags session_id samesite=lax secure; # requires nginx 1.19.8
}
# common gzip
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
# # Enable data compression
# gzip_min_length 1100;
# gzip_buffers 4 32k;
# gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript application/x-javascript;
# gzip_vary on;
# # Increase proxy buffer size
# proxy_buffers 16 64k;
# proxy_buffer_size 128k;
# # Force timeouts if the backend dies
# proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
# # Cache static data
# location ~* /web/static/ {
# proxy_cache_valid 200 60m;
# proxy_buffering on;
# expires 864000;
# proxy_pass http://odoo-backend;
# }