0, Preface
Recently, I was busy moving the server. After finally moving it, I accidentally deleted the kernel and started all over again. When using Pagoda one-click migration API version, I found that when migrating to a new server, each website will report an error when it is created:
1 | nginx: [emerg] unknown "connection_upgrade" variable |
So find information to solve the problem, and record it here.
2. Solution
In the main NGINX configuration file, add:
1 | http { ... #The default configuration is omitted above, and the following code can be added at the end map $http_upgrade $connection_upgrade { default upgrade; '' close; } } |
The function is to map the connection_upgrade
variable to the http_upgrade
variable.
3, the cause of the error
I don’t know which version the pagoda is in, so I added it to all reverse proxies:
1 | proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; # proxy_hide_header Upgrade; |
To support anti-generation WebSocket connection, may be to prevent Xiaobai from going to the forum to ask questions .
Finally, it is recommended that all programs (NGINX, Apache, MySQL, PHP) be compiled and installed. Recently, I heard that compiling and installing Pagoda will cause the server to be hung up or even invaded.
Fix Nginx Unknown Variable $connection_upgrade
Comments