Skip to content

Instantly share code, notes, and snippets.

@anoureldin
Forked from syci/odoo.conf
Last active August 11, 2022 20:59
Show Gist options
  • Save anoureldin/fb7d148b14b147befd1fd82fb1adf052 to your computer and use it in GitHub Desktop.
Save anoureldin/fb7d148b14b147befd1fd82fb1adf052 to your computer and use it in GitHub Desktop.
Apache2 Odoo Config
<VirtualHost *:443>
ServerAdmin webmaster@example.com
ServerName odoo.example.com
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/ssl/wildcard.example.com/public.crt
SSLCertificateKeyFile /etc/ssl/wildcard.example.com/private.pem
RequestHeader set X-Forwarded-Proto "https"
<IfModule mod_rewrite.c>
RewriteEngine On
# Permanent redirect (301 HTTP) if no canonical domain name
RewriteCond %{HTTP_HOST} !^odoo.example.com
RewriteRule ^/(.*)$ https://odoo.example.com/$1 [R=301,NE,L]
</IfModule>
<Location "/" >
Order deny,allow
Deny from all
Allow from all
</Location>
<Location "/web/database/manager" >
Order deny,allow
Deny from all
Allow from 192.168.122.0/24 127.0.0.0/255.0.0.0 ::1/128
</Location>
<Location "/website/info" >
Order deny,allow
Deny from all
Allow from 192.168.122.0/24 127.0.0.0/255.0.0.0 ::1/128
</Location>
# Comment to disable proxy
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /longpolling/ http://localhost:8072/longpolling/ retry=0
ProxyPassReverse /longpolling/ http://localhost:8072/longpolling/ retry=0
ProxyPass / http://localhost:8069/ retry=0
ProxyPassReverse / http://localhost:8069/ retry=0
ErrorLog /var/log/apache2/odoo.example.com-ssl.error.log
LogLevel warn
CustomLog /var/log/apache2/odoo.example.com-ssl.access.log combined
</VirtualHost>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment