search

Home  >  Q&A  >  body text

http-2 - How to configure HTTP/2 for remote node-inspector using Nginx?

Derived from a problem on the Internet using remote node-inspector debugging
http://stackoverflow.com/a/32066649/883571
According to the existing commands, I found that node-inspector can be used as A site is started on a remote server:

node-debug --web-host=0.0.0.0 --cli app.js

Then the local area can be directly accessed through the corresponding address:

http://<the-domain>:8080/?port=5858

The problem I encountered was that the DevTools had too many small files and the loading was very slow.
So I thought of some solutions, such as using HTTP/2 to solve the problem of loading small files.
Roughly, I changed the backend to 8080 The port is mapped to a certain location.
There is also a side problem, that is, its WebSocket connection also needs to be changed to the wss:// protocol.
I tried configuring it but it didn’t work. I would like to ask students with more back-end experience how to solve the problem completely?

仅有的幸福仅有的幸福2741 days ago712

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-05-16 17:19:14

    nginx seems to support h2c, but the browser does not support it. So you need:

    • Install nginx 1.10

    • Get the HTTPS certificate

    • Configure nginx. Just write listen 443 ssl h2; in the server section and use HTTP/2

    • location section uses proxy_pass to pass to your backend program

    reply
    0
  • Cancelreply