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

FYI How to use with NGINX proxy #193

Open
geemang2022 opened this issue Jan 31, 2024 · 1 comment
Open

FYI How to use with NGINX proxy #193

geemang2022 opened this issue Jan 31, 2024 · 1 comment

Comments

@geemang2022
Copy link

I was having an issue getting the reloads to work. It turns out that NGINX is not allowing the events to be propagated.

upstream web {
  server web:8000;
}

server {
...
  location /__reload__ {
    proxy_pass http://web;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header SSL_PROTOCOL https;
    add_header X-DEBUG-RELOAD 1 always;
    proxy_set_header Host   $host;

    proxy_buffering off;
    proxy_http_version 1.1;
    proxy_set_header Connection '';
    proxy_set_header Cache-Control 'no-cache';
    chunked_transfer_encoding off;
  }
}
@evilmonkey19
Copy link

It's quite weird to this kind of hot reloads like development but in production. Actually it is not recommended at all as you are allowing possible attacks easily. Personally, I believe that the best practice here would be to the reload in development and once developed you can do a push to your repository, and from there do the reload via a hook. This way you can achieve the same, but in a more secure and easier to understand way.

I'm sorry that I can't help more with this, but this architecture/functionality you are proposing is extremely rare.

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

2 participants