Skip to content

Instantly share code, notes, and snippets.

@jbarreraballestas
Last active May 30, 2024 18:09
Show Gist options
  • Save jbarreraballestas/cbe388d9b3b4697de5fc2164f28b4e73 to your computer and use it in GitHub Desktop.
Save jbarreraballestas/cbe388d9b3b4697de5fc2164f28b4e73 to your computer and use it in GitHub Desktop.
Odoo apache virtual host
<VirtualHost *:80>
ServerName myodoodomain.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =myodoodomain.com
RewriteRule ^ http://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName myodoodomain.com
ProxyRequests Off
ProxyPass / http://localhost:8069/ retry=0
ProxyPassReverse / http://localhost:8069/ retry=0
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS}
ProxyVia On
ProxyPreserveHost On
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:8069/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://127.0.0.1:8069/$1 [P,L]
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/myodoodomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/myodoodomain.com/privkey.pem
</VirtualHost>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment