当前位置:网站首页>Nignx configuring websocket
Nignx configuring websocket
2022-06-10 06:36:00 【I have an FC】
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 30m;
tcp_nopush on;
log_subrequest on;
tcp_nodelay on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
upstream www.cq.xxx.site {
ip_hash;
server 127.0.0.1:8081 weight=10;
}
# HTTPS server
server {
listen 443 ssl;
# To configure HTTPS The default access port for is 443.
# If not configured here HTTPS The default access port of , It may cause Nginx Can't start .
# If you use Nginx 1.15.0 And above , Please use listen 443 ssl Instead of listen 443 and ssl on.
server_name www.cq.xxx.site; # Replace with domain name bound by certificate .
ssl_certificate cert/5511216_www.cq.xxx.site.pem; # Replace with the name of the uploaded certificate file .
ssl_certificate_key cert/5511216_www.cq.xxx.site.key; # Need to put cert-file-name.key Replace with the name of the uploaded certificate key file .
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
# Represents the type of encryption suite used .
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Indicates the TLS The type of agreement .
ssl_prefer_server_ciphers on;
}
server {
listen 8080;
server_name www.cq.xxx.site; # Replace with domain name bound by certificate .
# Point to deployment through configuration port websocket Project
location /api/my_webscoket {
proxy_pass http://www.cq.xxx.site;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
}
The first way


The second way


边栏推荐
- Common status codes
- Model learning comprehension in Multi-Agent Reinforcement Learning Based on Model
- Opengauss database ODBC environment connection configuration (Windows)
- Statement that I am not a grey hat
- Scala fastjson modifying key or value
- Online chat -- Introduction and implementation of websocket
- OSPF route summary experiment
- BOM browser object model
- Thoroughly conquer function pointer
- How to extract some specific text in excel?
猜你喜欢

Machine learning notes - what are Bleu scores?

微信团队分享:微信后台在海量并发请求下是如何做到不崩溃的

Teleyecontroller v8.69 reconfiguration of keyboard recording function release by:yose

TeleyeControlor V8.16发布 完成注册表功能

火狐浏览器设置指向代理模式

虚拟机网络连接方式

Business topic: user usage path analysis

在 Kubernetes 中基于 StatefulSet 部署 MySQL(下)

QT上位机 通过EGM实时控制ABB

深度解析智能運維下告警關聯頻繁項集挖掘算法原理
随机推荐
李宏毅老师《机器学习》课程笔记-4.1 Self-attention
火狐浏览器设置指向代理模式
Determine whether the process has administrator privileges
基于对应点关系的——两片点云剔除(保留)重复点
Print linked list from end to end of sword finger offer
判断进程是否有管理员权限
Problem: interceptor missile
简述静态网页和动态网页的区别 Webl.0 和 Web2.0 的区别 简述 GET 和 POST 方法的区别
Using fieldmask to improve c grpc service performance yyds dry inventory
Baidu cloud address identification
What does seven bit ASCII mean
Basic usage of MySQL database
Embedded development | common operations of EEPROM driver code
YoseZang 原创 特征码定位器 SignatureTest V6.36 Rls 发布
Thank you for the Big White Rabbit candy of Yuyi children's shoes
Go zero micro Service Practice Series (II. Service splitting)
最长公共子序列
Model learning comprehension in Multi-Agent Reinforcement Learning Based on Model
Opengauss database ODBC environment connection configuration (Windows)
Nextcloud internal server error the server cannot complete your request workaround