Last active
July 31, 2019 08:32
-
-
Save funbaker/3edaded4e305dfe1192b to your computer and use it in GitHub Desktop.
odoo nginx static files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream odoo9_xmlrpc { | |
server <xmlrpc address>; | |
} | |
upstream odoo9_longpolling { | |
server <longpolling address>; | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name <public servername>; | |
return 301 https://<public servername>$request_uri; | |
} | |
server { | |
listen 443 ssl spdy; | |
listen [::]:443 ssl spdy; | |
server_name <public servername>; | |
charset utf-8; | |
root <odoo directory>; | |
ssl on; | |
ssl_certificate <public certificate>; | |
ssl_certificate_key <private key>; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; | |
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0 | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_tickets off; # Requires nginx >= 1.5.9 | |
ssl_stapling on; # Requires nginx >= 1.3.7 | |
ssl_stapling_verify on; # Requires nginx => 1.3.7 | |
ssl_dhparam <dhparams>; | |
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; | |
add_header X-Frame-Options SAMEORIGIN; | |
add_header X-Content-Type-Options nosniff; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header X-Forwarded-Proto https; | |
proxy_set_header Host $host; | |
proxy_pass http://odoo9_xmlrpc; | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; | |
proxy_buffer_size 128k; | |
proxy_buffers 16 64k; | |
proxy_redirect off; | |
proxy_connect_timeout 600; | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; | |
} | |
location /longpolling/ { | |
client_max_body_size 20M; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header X-Forwarded-Proto https; | |
proxy_set_header Host $host; | |
proxy_pass http://odoo9_longpolling; | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; | |
proxy_buffer_size 128k; | |
proxy_buffers 16 64k; | |
proxy_redirect off; | |
proxy_connect_timeout 600; | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; | |
} | |
location ^~ /[\/]+/static/ { | |
# EXPERIMENTAL proxy cache | |
#proxy_cache_valid 200 60m; | |
#proxy_buffering on; | |
#expires 864000; | |
proxy_pass http://odoo9_xmlrpc; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
anyone tried this configs with odoo 12 ?