http-2 - How to configure HTTP/2 for remote node-inspector using Nginx?
仅有的幸福
仅有的幸福 2017-05-16 17:17:14
0
1
718

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?

仅有的幸福
仅有的幸福

reply all(1)
左手右手慢动作

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template