I have an Omeka S installation distributed on three VMs.
VM1 is a public VM where the http traffic arrived.
VM2 is a private VM with the Omeka S installation
VM3 is a private VM with a mysql server and the database used in Omeka S.
In VM1, apache has a virtual host redirecting the traffic for domain x.com to the VM2 through port 8081
If I am connected though my VPN with direct access to VM2, I can access the file.
Without VPN, If I replace ip_vm2:8081by my domain name, I can access the file (because it goes through public VM1)
How can I configure Omeka S to using only URI with my domain name for files (and not the ip of the VM containing the files)?
I wrote that module: the difference there is it lets you just explicitly set what hostname you want the server to use when creating absolute URLs. Sometimes (if, for example, you don’t have control over the proxy you’re behind, or your local server configuration won’t accept a “fake” Host header) it’s important to have that greater level of control.
If you’re working fine with ProxyPreserveHost I wouldn’t necessarily bother with the module, but it’s another route that would work.
If you use the module ViewerJs (or PdfViewer) to display pdfs (and more) on a multiple VMs configuration, Apache ProxyPreserveHost On setting is not enough and you will have an error when displaying pdfs; the ServerUrlOverride module fixes it (and is very welcomed, thank you!).
P-S: It looks like there is no issue when using ServerUrlOverride on current master version 4.1.0-alpha6, the omeka_version_constraint = “^3.1.0”` could maybe be upgraded.
I do find it a little unexpected that there’s a difference between ProxyPreserveHost and ServerUrlOverride for the modules you mention, as the code they use to build URLs should pretty much be the same as is used anywhere else in Omeka S.
It’s possible the problem is related to the proxy forwarding an HTTPS connection to a HTTP backend. You might try adding an X-Forwarded-Proto header in the HTTPS vhost on the frontend proxy:
RequestHeader set X-Forwarded-Proto "https"
Of course if the other method of setting the URL is working for you, that’s fine too.