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
it forwards to
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).