Serving over HTTPS
This document describes the approach for those wishing to install ArchivesSpace in such a manner that all end-user requests (i.e., URLs) are served over HTTPS rather than HTTP. For the purposes of this documentation, the URLs for the staff and public interfaces will be:
https://staff.myarchive.org
- staff interfacehttps://public.myarchive.org
- public interface
The configuration described in this document is one possible approach, and to keep things simple the following are assumed:
- ArchivesSpace is running on a single Linux server
- The server is running Apache or Nginx
- You have obtained an SSL certificate and key from an authority
- You have ensured that appropriate firewall ports have been opened (80 and 443).
Step 1: Configure Web Server (Apache or Nginx)
Apache
Information about configuring Apache for SSL can be found at http://httpd.apache.org/docs/current/ssl/ssl_howto.html. You should read that documentation before attempting to configure SSL.
Setting up SSL
Use the NameVirtualHost
and VirtualHost
directives to proxy
requests to the actual application urls. This requires the use of the mod_proxy
module in Apache.
You may optionally set the Set-Cookie: Secure attribute
by adding Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
. When a cookie has the Secure attribute, the user agent will include the cookie in an HTTP request only if the request is transmitted over a secure channel.
Users may encounter a warning in the browser’s console stating Cookie “archivesspace_session” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts
(example from Firefox 104) or something similar. Some browsers (for example, Chrome version 80 or above) already enforce this. Standard ArchivesSpace installations should be unaffected, but if you encounter problems with integrations and/or customizations of your particular installation, the following directive may be required: Header edit Set-Cookie ^(.*)$ $1;SameSite=None;Secure
. Alternatively, it may be the case that SameSite=Lax
(the default) or even SameSite=Strict
are more appropriate depending on your functional and/or security requirements. Please refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite or other resources for more information.
Setting up Redirects
When running a site over HTTPS, it’s a good idea to set up a redirect to ensure any outdated HTTP requests are routed to the correct URL. This can be done through Apache as follows:
Nginx
Information about configuring nginx for SSL can be found at http://nginx.org/en/docs/http/configuring_https_servers.html You should read that documentation before attempting to configure SSL.
Step 2: Configure ArchivesSpace
The following lines need to be altered in the config.rb file:
These lines don’t need to be altered and should remain with their default values. E.g.: