Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kendrickjr/e751f07862da686c08c35663d41b1a88 to your computer and use it in GitHub Desktop.
Save kendrickjr/e751f07862da686c08c35663d41b1a88 to your computer and use it in GitHub Desktop.
Configure Nginx Reverse Proxy for Dspace7

To be able to access the Dspace Frontend using the domain name or IP address with default port 80 instead of 4000, we need to configure a reverse proxy. For the purpose and simplicity in this guide, we will use Nginx. But you na use othe engine such as Apache

STEP 1:

Install Nginx on Ubuntu with the command:

  sudo apt install nginx -y

STEP 2:

Create a virtual host file:

sudo nano /etc/nginx/conf.d/dspace_ui.conf

STEP 3:

Add the below lines replacing your domain name/IP address appropriately:

server {
  listen 80;
  server_name    YOUR-DOMAIN-NAME;
  access_log /var/log/nginx/dspace-access.log;
  error_log /var/log/nginx/dspace-error.log;

    location / {
        proxy_pass http://localhost:4000/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

STEP 4:

Once created, restart nginx:

sudo service nginx restart

Step 5 – Access Dspace 7 Front End

Now you should be able to access your Dspace 7 Frontend using your domain name or IP address. For example http://dspace.navitrack.co.tz

NOTE

In case you find error 500, you need to modify the dspace.ui.url on your Dspace Backend to match what you are trying to access the server with.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment