Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reload code not served through nginx reverse proxy #274

Open
nsadeh opened this issue Oct 31, 2023 · 0 comments
Open

reload code not served through nginx reverse proxy #274

nsadeh opened this issue Oct 31, 2023 · 0 comments

Comments

@nsadeh
Copy link

nsadeh commented Oct 31, 2023

Due to a complex backend inherited situation, I have an nginx setup through which I am trying to proxy to elm-live when I develop. Here is the nginx config:

location / {
            
            proxy_pass http://127.0.0.1:3000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
            proxy_set_header Host $host;
            
            try_files /outage$uri /$tenant$uri $uri $uri/ =404;
        }

I run elm-live like this

elm-live src/Main.elm --port=3000 --pushstate -h 127.0.0.1 --dir=dist --verbose --hot -- --output=dist/app.js --debug

When I to to 127.0.0.1:3000 and make changes, hot reloading works. I can see that modified HTML pointing to the reload.js file in my sources. Note however that this is not a workaround, as this app cannot proxy to the backend so it doesn't do much.

When I go to my nginx endpoint (hostname.me:8080), I can see the app working, but hot-reloading doesn't work. When I go to the sources folder, I can see that the HTML file is modified to include reload.js, but the file doessn't itself seem to be served.

Why is that? Is there a way to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant