I want to use Caddy Server as a reverse proxy server. How do I configure my virtual hosts (Caddyfile) to work with proper real (remote) IPs and automatic SSL? At the moment, the Odoo logs show the Proxy-Server IP as request origin, despite of the proper proxy-mode setting in the file odoo.conf.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
Prerequisites:
Set-up and deploy Caddy Server according to your preferences, preferably on a dedicated server.
Set "proxy_mode = True" in your odoo.conf file
Make sure you have installed werkzeug Version 0.11 or higher (Ubuntu 18.04 provides werkzeug 0.10.4 only). Example for Ubuntu 18.04 and Odoo 11.0 or higher (Python 3):
sudo -H pip3 install werkzeug -U
For Odoo versions < 11.0 use "pip" instead of "pip3".
As long as this feature request is not implemented, the preset "transparent" of the Caddy proxy directive is not sufficient to work properly. The argument "header_upstream X-Forwarded-Host {host}" must be added manually.
See a sample Caddyfile for a successful Odoo proxying with automatic SSL:
example.com {
redir https://www.example.com
}
www.example.com {
proxy / http://xxx.xxx.xxx.xxx:8069 {
transparent
header_upstream X-Forwarded-Host {host} # transparent preset is not enough
# header_upstream X-Odoo-dbfilter databasename # in case you use dbfilter_from_header
}
# proxy /longpolling http://xxx.xxx.xxx.xxx:8072 { # in case you use it
# transparent
# }
# realip cloudflare (only in case you use cloudflare as CDN)
gzip
log /var/log/caddy/example.access.log
errors /var/log/caddy/example.error.log
# tls { (only in case you use Cloudflare as CDN)
# dns cloudflare
# }
}
For Caddy Server version 2.0 and higher please revert to this post:
https://www.odoo.com/fr_FR/forum/aide-1/automatic-ssl-easy-way-to-secure-your-odoo-website-domains-using-caddy-server-2-and-let-s-encrypt-certificates-176598
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
0
mag 23
|
2035 | ||
|
2
giu 21
|
15052 | ||
Certificate SSL
Risolto
|
|
5
gen 24
|
26048 | |
|
2
giu 23
|
2650 | ||
|
1
lug 22
|
3023 |