#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
client_max_body_size 0;
#gzip on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 18880;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html/maccms10/maccms10-master;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
#访问目录下文件
location /file {
alias /home;
#开启子目录访问
autoindex on;
}
location /wapi {
proxy_pass http://localhost:18887/demo;
# 5分钟内没有数据交互自动断开连接
proxy_read_timeout 300;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Nginx配置websocket代理
最新推荐文章于 2024-03-31 22:47:01 发布