Assets 0 Size and Bad Relative URLs
Created by: m1st0
Summary I tried all I could to serve Gitlab 6.5.1 (now 6.6.4) from a relative URL using the following but failed: http://stackoverflow.com/questions/21768703/how-can-i-get-gitlab-6-5-to-show-its-icons-under-a-apache-2-4-proxy
I gave up and moved it all back to the way it should be under a root domain without the relative URL at https://github.eyetechds.com .
However, it pains me to find that the CSS assets are now asking for items with the relative root I was trying to get it to use. My main issue is that I can't regenerate the assets correctly no matter what using (the rake execution command completes without errors)
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
and have the relative URL root removed within the CSS assets.
In the previous instance, I couldn't get them to generate a CSS file that linked to the fonts under the relative root. Now it is the opposite situation. Now the CSS file has the relative root and I can't get off. I tried to test if I could even get the assets directly to make sure they are downloading, but they return with a size 0. I removed SSL to see if there was any issue with encryption, but that didn't make the assets return without a 0 size either.
So now it is running stable but no fonts and icons are created correctly in the CSS files. If you watch the Net panel in Firebug with Firefox while loading my site, you can see the issue.
The CSS file is loaded correctly, but it refers to the wrong "relative" links for fonts, and other assets. I even tried to get Apache to proxy the bad relative URLs to grab the right fonts, images, etc. However, even that fails with each asset returning with status 200 OK but size 0.
Yes, I did do the following and restarted Gitlab and Apache.
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
Output of checks All passed.
Partial Apache config in SSL
ServerName gitlab.eyetechds.com
<Proxy *>
Require all granted
</Proxy>
ServerSignature Off
# needed for downloading attachments
DocumentRoot /home/git/gitlab/public
#ProxyVia on
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
SSLProxyEngine On
ProxyRequests Off
ProxyPass / http://127.0.0.1:8085/
ProxyPassReverse / http://127.0.0.1:8085/
Options -Multiviews
#apache equivalent of nginx try files
# http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
# http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8085/%{REQUEST_URI} [P,QSA]
#Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
ErrorDocument 404 /404.html
ErrorDocument 422 /422.html
ErrorDocument 500 /500.html
ErrorDocument 503 /deploy.html
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
ErrorLog /var/log/apache2/gitlab-ssl_error.log
CustomLog /var/log/apache2/gitlab-ssl_forwarded.log common_forwarded
CustomLog /var/log/apache2/gitlab-ssl_access.log combined env=!dontlog
CustomLog /var/log/apache2/gitlab-ssl.log combined