Date: Tue, 19 Mar 2024 06:26:36 -0400 (EDT) Message-ID: <824579713.9015.1710843996681@lyrasis1-roc-mp1> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9014_1794456349.1710843996680" ------=_Part_9014_1794456349.1710843996680 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
NginX is a fast, lightweight alternative to Apache, and can be u= sed as a front-end for serving Tomcat pages. The docs on how to set this up= are scattered all over the web, so I thought I'd bring them together here.=
First of all, I have the following in my Tomcat server.xml file:
<Hos= t name=3D"localhost" appBase=3D"webapps" unpackWARs=3D"true" autoDeploy=3D"true" xmlValidation=3D"false" xmlNamespaceAware=3D"false"> <Context path=3D"/dspace" docBase=3D"/path/to/dspace/webapps/jsp= ui" debug=3D"0" reloadable=3D"true" cachingAllowed=3D"false" allowLinking=3D"true" /> <Context path=3D"/xmlui" docBase=3D"/path/to/dspace/webapps/xmlu= i" debug=3D"0" reloadable=3D"true" cachingAllowed=3D"false" allowLinking=3D"true" /> <Context path=3D"/oai" docBase=3D"/path/to/dspace/webapps/oai" d= ebug=3D"0" reloadable=3D"true" cachingAllowed=3D"false" allowLinking=3D"true" /> </Host>
This gives me the flexibility to use both the JSPUI and the XMLUI if nee= ded.
I have DSpace running on a subdomain, "http://collections.example.com/ds= pace/". This is configured as a virtual host in NginX.
server = { =09listen 111.222.11.22:80; =09server_name collections.example.com; =09access_log /var/log/collections.example.com/access_log; =09error_log /var/log/collections.example.com/error_log; =09root /path/to/dspace/webapps/; =09 location / { deny all; } =09location /dspace/ { =09=09index index.jsp; =09=09proxy_set_header X-Forwarded-Host $host; =09=09proxy_set_header X-Forwarded-Server $host; =09=09proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; =09=09proxy_pass http://111.222.11.22:8180/dspace/; =09=09proxy_redirect=09http://111.222.11.22:8180/dspace/ http://collections= .example.com/dspace/; =09=09 =09=09proxy_buffering off; =09=09proxy_store =09off; =09=09proxy_connect_timeout 120; =09=09proxy_send_timeout 120; =09=09proxy_read_timeout 120; =09} =09location /oai/ { =09=09proxy_set_header X-Forwarded-Host $host; =09=09proxy_set_header X-Forwarded-Server $host; =09=09proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; =09=09proxy_pass http://111.222.11.22:8180/oai/; =09=09proxy_redirect=09http://111.222.11.22:8180/oai/ http://collections.ex= ample.com/oai/; =09=09 =09=09proxy_buffering off; =09=09proxy_store =09off; =09=09proxy_connect_timeout 120; =09=09proxy_send_timeout 120; =09=09proxy_read_timeout 120; =09} =09location /xmlui/ { =09=09proxy_set_header X-Forwarded-Host $host; =09=09proxy_set_header X-Forwarded-Server $host; =09=09proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; =09=09proxy_pass http://111.222.11.22:8180/xmlui/; =09=09proxy_redirect=09http://111.222.11.22:8180/xmlui/ http://collections.= example.com/xmlui/; =09=09 =09=09proxy_buffering off; =09=09proxy_store =09off; =09=09proxy_connect_timeout 120; =09=09proxy_send_timeout 120; =09=09proxy_read_timeout 120; =09=09 =09} }
I've set the proxy timeouts somewhat high since we're uploading large fi= les into our DSpace instance. So far it's been working great. The only othe= r thing that I've changed is to add
client_= max_body_size 2000m;
to the "http" section of my nginx.conf file. This sets the uploaded file= limit to 2GB.