1

I am very new with nginx and bitbucket server setup. I have an nginx server setup in front of bitbucket instance (running on port 7990). Below is my configuration of /etc/nginx/sites-available/default (not /etc/nginx/nginx.conf)

    server {
            listen 80 default_server;
            listen [::]:80 default_server;

            root /var/www/html;

            index index.html index.htm index.nginx-debian.html;

            server_name _;
            location / {
                    # First attempt to serve request as file, then
                    # as directory, then fall back to displaying a 404.
                    try_files $uri $uri/ =404;
            }
            location /bitbucket/ {
                     proxy_set_header X-Forwarded-Host $host;
                     proxy_set_header X-Forwarded-Server $host;
                     proxy_set_header X-Forwarded-For 
                     $proxy_add_x_forwarded_for;
                     proxy_pass http://127.0.0.1:7990/;
                     sendfile off;
                     expires  0;
                     add_header Cache-Control private;
                     add_header Cache-Control no-store;
                     add_header Cache-Control no-cache;
            }
    }

Now if I hit

http://my_ip/bitbucket

it forwards to

http://my_ip/bitbucket/setup

page, but fails to load css and js files.

When I see the html source of setup page, it includes some js/css files' absolute paths while importing (e.g. link type="text/css" rel="stylesheet" href="/s/277823dc49fd32854c324f87e345f7f6-CDN/-196139424/aef68c7/1/1b615eee93091f36273c8450f7d72556/_/download/contextbatch/css/_super/batch.css"). This seems like nginx is looking for the css files in "s" folder under its own directory. I also checked that

http://my_ip/bitbucket/s/277823dc49fd32854c324f87e345f7f6-CDN/-196139424/aef68c7/1/1b615eee93091f36273c8450f7d72556/_/download/contextbatch/css/_super/batch.css

Url returns the page in browser.

Please let me know how to load css/js files. I also want to know why the css url is so ugly(it seems that it includes some random numbers).

Abhishek Chatterjee
  • 1,962
  • 2
  • 23
  • 31
  • I also am experiencing the same error, with similar configuration. Did you ever find a solution to this? – MikeyE Jun 18 '18 at 15:30
  • Not real solution, but I twiked the nginx file url and reverse proxy configurations (trial & error) and suddenly it started working. I dont have that access to that machine currently, otherwise I could give you the config. – Abhishek Chatterjee Jun 20 '18 at 11:32

0 Answers0