Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

NGinX:

cat << 'EOF' >/etc/nginx/proxy.conf
proxy_redirect          off;
proxy_set_header        Host                    $host;
proxy_set_header        X-Real-IP               $remote_addr;
proxy_set_header        X-Forwarded-For         $proxy_add_x_forwarded_for;
proxy_set_header        X-Forwarded-Host        $host:$server_port;
proxy_set_header        X-Forwarded-Server      $host:$server_port;
proxy_set_header        X-Forwarded-Proto       $scheme;
client_max_body_size    10m;
client_body_buffer_size 128k;
proxy_connect_timeout   90;
proxy_send_timeout      90;
proxy_read_timeout      90;
proxy_buffers           32 4k;
proxy_pass_request_headers on;
EOF
        include                 /etc/nginx/proxy.conf;


Apache:

https://docs.openproject.org/installation-and-operations/installation/docker/#apache-reverse-proxy-setup

Note: I like to delete everything under "/etc/openproject/addons/apache2/includes/vhost" regarding apache and configure in the apache configuration....

rm /etc/openproject/addons/apache2/includes/vhost/*ssl*
cat << 'EOF' >/etc/apache2/sites-available/openproject.conf
#Include /etc/openproject/addons/apache2/includes/server/*.conf
<VirtualHost *:80>
    ServerName domain.com

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

<VirtualHost *:443>
    ServerName domain.com
    DocumentRoot /????

    #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]

    RequestHeader set X-Forwarded-Proto 'https'
    ProxyRequests off
    ProxyPreserveHost On

    ProxyPass http://127.0.0.1:6000/ retry=0
    ProxyPassReverse http://127.0.0.1:6000/

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