eml_analyzer icon indicating copy to clipboard operation
eml_analyzer copied to clipboard

Fix relative paths

Open jfstenuit opened this issue 1 year ago • 3 comments

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.

jfstenuit avatar Feb 27 '25 16:02 jfstenuit

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?

ninoseki avatar Feb 28 '25 06:02 ninoseki

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

jfstenuit avatar Feb 28 '25 10:02 jfstenuit

Hmm okay but what do you think about subdomain option?

ninoseki avatar Feb 28 '25 10:02 ninoseki