title: Gitlab 15.2.2 Behind Apache2 works but can't push to gitlab registry
body: <p>I installed the latest CE version of gitlab behind Apache2 and it's working fine with HTTPS and i get login success for gitlab registry but when i try to push to gitlab registry i get
  &quot; error parsing HTTP 404 response body: invalid character '&lt;' &quot; when i checked the gitlab logs i get this error</p>
  <p>this is the gitlab config</p>
  <pre><code>external_url &quot;https://domain&quot;
  
  nginx['ssl_certificate'] = &quot;/etc/letsencrypt/live/domain/fullchain.pem&quot;
  
  nginx['ssl_certificate_key'] = &quot;/etc/letsencrypt/live/domain/privkey.pem&quot;
  
  nginx['enable'] = false
  
  registry_external_url 'https://domain'
  
  gitlab_rails['registry_enabled'] = true
  
  gitlab_rails['registry_host'] = &quot;domain&quot;
  
  gitlab_rails['registry_path'] = &quot;/var/opt/gitlab/gitlab-rails/shared/registry&quot;
  
  gitlab_workhorse['enable'] = true
  
  gitlab_workhorse['listen_network'] = &quot;tcp&quot;
  
  gitlab_workhorse['listen_addr'] = &quot;127.0.0.1:8181&quot;
  </code></pre>
  <p>this is apache2 vHost</p>
  <pre><code>&lt;VirtualHost *:443&gt;
  
    ServerName  domain
  
    ServerSignature Off
  
    ProxyPreserveHost On
  
    AllowEncodedSlashes NoDecode
  
    ProxyRequests     Off
  
  
  
   &lt;Location /&gt;
  
      Require all granted
  
      ProxyPassReverse http://127.0.0.1:8080
  
      ProxyPassReverse http://domain/
  
    &lt;/Location&gt;
  
    RewriteEngine on
  
    RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,L]
  
    RewriteRule /[-\/\w\.]+\.git\/ http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,L]
  
  
  
    #Forward any other requests to GitLab Rails app (Unicorn)
  
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
  
    RewriteCond %{REQUEST_URI} ^/uploads
  
    RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA,NE]
  
  
  
  
   RewriteCond %{REQUEST_URI} ^/[\w\.-]+/[\w\.-]+/gitlab-lfs/objects.* [OR]
  
    RewriteCond %{REQUEST_URI} ^/[\w\.-]+/[\w\.-]+/builds/download.* [OR]
  
    RewriteCond %{REQUEST_URI} ^/[\w\.-]+/[\w\.-]+/repository/archive.* [OR]
  
    RewriteCond %{REQUEST_URI} ^/api/v3/projects/.*/repository/archive.* [OR]
  
    RewriteCond %{REQUEST_URI} ^/ci/api/v1/builds/[0-9]+/artifacts.* [OR]
  
    RewriteCond %{REQUEST_URI} ^/[\w\.-]+/[\w\.-]+/(info/refs|git-upload-pack|git-receive-pack)$
  
    RewriteCond %{REQUEST_URI} ^/[\w\.-]+/[\w\.-]+/builds/download.* [OR]
  
  
  
  
   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  
  
  
    Header always set Docker-Distribution-Api-Version &quot;registry/2.0&quot;
  
   DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
  
  Header edit Location ^http://domain/ https://domain/
  
  RequestHeader set X-Forwarded-Proto &quot;https&quot;
  
  RequestHeader set X-Forwarded-Ssl on
  
  Include /etc/letsencrypt/options-ssl-apache.conf
  
  SSLCertificateFile /etc/letsencrypt/live/domain/fullchain.pem
  
  SSLCertificateKeyFile /etc/letsencrypt/live/domain/privkey.pem
  
  &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/RTof7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RTof7.png" alt="enter image description here" /></a>
  <strong>this is the error from production.log of gitlab</strong></p>
  <pre><code>Started GET &quot;/jwt/auth?account=root&amp;scope=repository%3Aroot%2Ftestrepo%3Apush%2Cpull&amp;service=dependency_proxy&quot; for 41.****** at 2022-08-08 10:25:39 +0000
  Processing by JwtController#auth as HTML
    Parameters: {&quot;account&quot;=&gt;&quot;root&quot;, &quot;scope&quot;=&gt;&quot;repository:root/testrepo:push,pull&quot;, &quot;service&quot;=&gt;&quot;dependency_proxy&quot;}
  Completed 200 OK in 116ms (Views: 0.2ms | ActiveRecord: 7.6ms | Elasticsearch: 0.0ms | Allocations: 8016)
  
  Started POST &quot;/v2/root/testrepo/blobs/uploads/&quot; for 41.*****at 2022-08-08 10:25:39 +0000
  
  Started POST &quot;/v2/root/testrepo/blobs/uploads/&quot; for 41.**** at 2022-08-08 10:25:39 +0000
  
  Started HEAD &quot;/v2/root/testrepo/blobs
  
  /sha256:f3446470f297e51c1e27f90f7ae9a94f1ee7b6c8e529aec83aa1a04ad70531c0&quot; for 41.226.13.145 at 2022-08-08 10:25:39 +0000
  
  Started POST &quot;/v2/root/testrepo/blobs/uploads/&quot; for 41.**** at 2022-08-08 10:25:39 +0000
  
  Started POST &quot;/v2/root/testrepo/blobs/uploads/&quot; for 41.***** at 2022-08-08 10:25:39 +0000
  
    
  ActionController::RoutingError (No route matches [POST] &quot;/v2/root/testrepo/blobs/uploads&quot;):
    
  lib/gitlab/middleware/basic_health_check.rb:25:in `call'
  
  lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
  
  lib/gitlab/middleware/request_context.rb:21:in `call'
  
  lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'
  
  config/initializers/fix_local_cache_middleware.rb:11:in `call'
  
  lib/gitlab/middleware/compressed_json.rb:26:in `call'
  
  lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
  
  lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
  
  lib/gitlab/metrics/requests_rack_middleware.rb:77:in `call'
  
  lib/gitlab/middleware/release_env.rb:13:in `call'
  </code></pre>