Prerequisites
- Nginx is installed and running on your server.
- GitBucket is running on some
port. The default is 8080.
- Know what domain you want GitBucket running
Nginx uses a configuration structure for virtual hosts that looks like /etc/nginx/sites-available and /etc/nginx/sites-enabled. This is fairly self-explanatory: the sites-available directory is site configuration files that are available and may more or may not be enabled and sites-enabled are site configuration files which are live and Nginx is serving.
Configuration
- Create a file like /etc/nginx/sites-available/gitbucket
- Add the following to the file:
- Make a symlink to sites-enabled. E.g.:
- Check the Nginx configuration
nginx -t
- If that returns no errors, restart your Nginx server.
Assets caching
To improve GitBucket performance, you should add the following configuration to enable assets caching:
If you have never configured the cache zone, add the following line to the top level of the Nginx configuration file.