Moerill / fvtt-chat-notifications

MIT License
9 stars 6 forks source link

[BUG] the module has missing resources when running foundry under a reverse proxy location #14

Open Snogard opened 3 years ago

Snogard commented 3 years ago

Describe the bug When using foundry under a reverse proxy location, the gsap-core.js module is not loaded. /scripts/greensock/esm/gsap-core.js

To Reproduce Steps to reproduce the behavior:

  1. Create a reverse proxy configuration using a location
  2. Start foundry and enable the module in an empty world
  3. Wait for reload

Now if you open the console you should get an error. If i manually add the location name to the path, then the gsap.core.js is found. exmaple (if i have foundry under /test location): does not work: example.com/scripts/greensock/esm/gsap-core.js <-- this is what your modules looks for right now works: example.com/test/scripts/greensock/esm/gsap-core.js

Expected behavior Module settings are should be visible and notifications should work

Server:

Example Nginx config

location /test {
    proxy_http_version 1.1;

    proxy_read_timeout 90;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;

    proxy_pass http://localhost:30000;
}

If you need more info feel free to ask :)

Moerill commented 3 years ago

Thanks for the bug report. When i finally get back to fixing this for 0.8.x i'll try to fix this.

As a reminder for me: Switch back to loading the gsap library using the module.json and not as esm module import. (I kinda forgot about doing that.. )

And for clarification: This is not a general reverse proxy issue, only when you put foundry behind a reverse proxy on a subdomain like your-domain.com/something instead of your-domain.com