Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

CSS and Script files not found behind Apache reverse proxy

rucotec April 21, 2022

Installed Bitbucket 7.21 on Ubuntu 20.04. Everything works when I directly connect to http://bitbucket.myserver.mytld:7990.

I configured Apache2 reverse proxy and now none of the CSS, img, and JS resources are found, I simply get the plain unadorned html. That indicates that the bitbucket server IS being accessed through the proxy, just none of the resources are there. Comparing the <img src=... and other resource paths with the WebInspector shows that they are identical between a page directly accessed vs. the same page accessed through the proxy.

resources-not-found.jpg

Here is my virtual host file:

<VirtualHost *:80>
    ServerName bitbucket.myserver.mytld
    ServerAdmin webmaster@localhost
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    ProxyPreserveHost On
    ProxyRequests Off
    ProxyVia Off
    <Proxy *>
        Require all granted
    </Proxy>
    ProxyPass / http://localhost:7990/bitbucket
    ProxyPassReverse / http://localhost:7990/bitbucket
</VirtualHost>

and bitbucket.properties

# context path
server.context-path=/bitbucket

#### settings for http
server.scheme=http
server.proxy-port=80
server.proxy-name=bitbucket.myserver.mytld


What am I missing?

Thanks for any help

 

1 answer

0 votes
Graham Twine _Slm_ April 21, 2022

When you look at the page you are loading in the image above with Dev tools what is the error code and the URL of the resources that fail to load?

Hopefully that will guide you. Is it a 403 or a 404?
Is the URL a legitimate URL?

 

Given you are also seeing "Oops you found a dead link" indicates the context may be work.

Have a look at the  setup in your ${JIRA_INSTALL}/conf/server.xmlas well.

rucotec April 21, 2022

here is one such url copied from the web inspector.

http://bitbucket.myserver.mytld/s/-888238628/6dea001/n1cn5w/1.0/_/download/resources/com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:bitbucket-logo/images/logo/bitbucket.svg

The url is identical for direct connect to 7990 as well as for the proxy connection. Connecting through the proxy gives a 404 not found, direct connect shows the bitbucket.svg logo. Same issue for everything that is referenced from the html like img, scripts, css etc.

Graham Twine _Slm_ April 22, 2022

Do you have the correct configuration in your ${server_home_dir}/conf/server.xml?

 

Confirm the proxyHost='bitbucket.myserver.mytld' 

The proxyPort and the scheme are set correctly

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events