Fix relative paths
Changes to allow running eml_analyzer from a sub-path, for instance lab.company.com/eml_analyzer/
Requires setting up a reverse proxy and a matching setting in VITE_BASE_PATH environment variable.
I understand your pain point but I don't want to make this app complicated to support sub-path/directory.
I recommend you to use reverse proxy or why don't you use subdoman like eml-analyzer.lab.company.com?
Actually, the changes in this PR are done to enable the good working of the application behind a reverse proxy.
Configuration of NginX reverse proxy :
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
...
location /eml_analyzer/ {
proxy_pass http://192.168.0.193:5173;
}
}
It doesn't get more complex than those 11 lines changed in the PR. The rest is automatically taken into account by vite. All the contributors can keep on improving the project without changing anything in their way of working.
Without the changes in this PR, the reverse proxy configuration above fails because eml_analyzer returns HTML/JS/CSS code that refers to the root of the URL. As responses are not altered by the reverse proxy, this cause the application to fail.
See that part of the doc for details : https://vite.dev/config/shared-options.html#base
Hmm okay but what do you think about subdomain option?