Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
cat << 'EOF' >/etc/apache2/sites-available/openproject.conf
Include /etc/openproject/addons/apache2/includes/server/*.conf
<VirtualHost *:8080>
    ServerName domain.com

    RewriteEngine on
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*)$ https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>

<VirtualHost *:4443>
    ServerName domain.com
    DocumentRoot /opt/openproject/public

    Include /etc/openproject/addons/apache2/includes/vhost/*.conf
  
    SSLEngine on
    SSLCertificateFile /etc/ssl/cert.crt
    SSLCertificateKeyFile /etc/ssl/cert.key

    RewriteEngine on
    RewriteRule "^$" "/" [R,L]

   <Location "/">
      RequestHeader set X-Forwarded-Proto 'https'

      ProxyPreserveHost On
      ProxyPassProxyPass / http://127.0.0.1:80806000/ retry=0
    ProxyPassReverse / ProxyPassReverse http://127.0.0.1:8080/
    </Location>6000/

</VirtualHost>
EOF
ln -s /etc/apache2/sites-available/openproject.conf /etc/apache2/sites-enabled/openproject.conf
systemctl restart apache2