Last active
September 27, 2018 17:53
-
-
Save andrius-preimantas/1c0ac1406154fd736fca to your computer and use it in GitHub Desktop.
Nginx proxy configuration for Odoo v8
This file contains 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 odoo8 { | |
server 0.0.0.0:8069 weight=1 fail_timeout=0; | |
} | |
upstream odoo8-im { | |
server 0.0.0.0:8072 weight=1 fail_timeout=0; | |
} | |
## http redirects to https ## | |
server { | |
listen 80; | |
server_name MY_SERVER_NAME; | |
# Strict Transport Security | |
add_header Strict-Transport-Security max-age=2592000; | |
return 301 https://MY_SERVER_NAME$request_uri; | |
} | |
server { | |
# server port and name | |
listen 443; | |
server_name MY_SERVER_NAME; | |
# Specifies the maximum accepted body size of a client request, | |
# as indicated by the request header Content-Length. | |
client_max_body_size 200m; | |
# add ssl specific settings | |
keepalive_timeout 60; | |
ssl on; | |
ssl_certificate /etc/ssl/nginx/MY_SERVER_NAME.crt; | |
ssl_certificate_key /etc/ssl/nginx/MY_SERVER_NAME.key; | |
# limit ciphers | |
ssl_ciphers HIGH:!ADH:!MD5; | |
ssl_protocols SSLv3 TLSv1; | |
ssl_prefer_server_ciphers on; | |
# increase proxy buffer to handle some OpenERP web requests | |
proxy_buffers 16 64k; | |
proxy_buffer_size 128k; | |
#general proxy settings | |
# force timeouts if the backend dies | |
proxy_connect_timeout 1200s; | |
proxy_send_timeout 1200s; | |
proxy_read_timeout 1200s; | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; | |
# set headers | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; | |
# Let the OpenERP web service know that we’re using HTTPS, otherwise | |
# it will generate URL using http:// and not https:// | |
proxy_set_header X-Forwarded-Proto https; | |
# This header is checked by Odoo (together with proxy_mode) to determin | |
# server is proxied | |
proxy_set_header X-Forwarded-Host $http_host; | |
# by default, do not forward anything | |
proxy_redirect off; | |
proxy_buffering off; | |
location /longpolling { | |
proxy_pass http://odoo8-im; | |
} | |
# cache some static data in memory for 60mins. | |
# under heavy load this should relieve stress on the OpenERP web interface a bit. | |
location /web/static/ { | |
proxy_cache_valid 200 60m; | |
proxy_buffering on; | |
expires 864000; | |
proxy_pass http://odoo8; | |
} | |
location / { | |
proxy_pass http://odoo8; | |
} | |
} |
This file contains 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
[options] | |
; This is the password that allows database operations: | |
admin_passwd = a1a1a1a1a1 | |
db_host = False | |
db_port = False | |
db_user = odoo | |
db_password = False | |
logfile = /var/log/odoo/odoo-server.log | |
addons_path=/opt/odoo/odoo-server/addons,/opt/odoo/custom-addons | |
db_maxconn = 64 | |
db_name = False | |
db_template = template1 | |
dbfilter = .* | |
db_password = a2a2a2a2a2a2 | |
auto_reload = False | |
csv_internal_sep = , | |
data_dir = /opt/odoo/odoo-data | |
db_maxconn = 64 | |
db_name = False | |
db_template = template1 | |
dbfilter = .* | |
debug_mode = False | |
demo = {} | |
email_from = False | |
geoip_database = /usr/share/GeoIP/GeoLiteCity.dat | |
import_partial = | |
limit_memory_hard = 2684354560 | |
limit_memory_soft = 2147483648 | |
limit_request = 8192 | |
limit_time_cpu = 9000 | |
limit_time_real = 12000 | |
list_db = True | |
log_db = False | |
log_handler = [':INFO'] | |
log_level = warn | |
logrotate = True | |
longpolling_port = 8072 | |
max_cron_threads = 2 | |
osv_memory_age_limit = 1.0 | |
osv_memory_count_limit = False | |
pg_path = None | |
pidfile = None | |
proxy_mode = True | |
reportgz = False | |
secure_cert_file = server.cert | |
secure_pkey_file = server.pkey | |
server_wide_modules = None | |
smtp_password = False | |
smtp_port = 25 | |
smtp_server = localhost | |
smtp_ssl = False | |
smtp_user = False | |
syslog = False | |
test_commit = False | |
test_enable = False | |
test_file = False | |
test_report_directory = False | |
timezone = False | |
translate_modules = ['all'] | |
unaccent = False | |
without_demo = False | |
workers = 5 | |
xmlrpc = True | |
xmlrpc_interface = | |
xmlrpc_port = 8069 | |
xmlrpcs = True | |
xmlrpcs_interface = | |
xmlrpcs_port = 8071 | |
sentry_client_dsn = https://nothing.com | |
sentry_enable_logging = False | |
sentry_include_context = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment