标题:NGINX重定向非http(原始套接字)和http(Web浏览器)流量
服务器既有来自原始套接字的非http请求,也有来自网络浏览器的来自端口443的http请求。想法是检查请求,并将非http请求传递到端口8086,将http请求传递到端口81。 这是我实施的想法:
http {
...
server {
listen 80;
# ... Redirect to port 443
}
# HTTPS server
server {
listen 443 ssl;
server_name cims2.crysberg.com;
ssl_certificate cert_chain.crt;
ssl_certificate_key private.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# The raw socket doesn't have user agent
if( $http_user_agent = "") {
####################################
### redirect location to /rawSocket
####################################
}
location / {
#pass the request to apache server
proxy_pass http://127.0.0.1:81;
}
location /rawSocket {
proxy_pass http://127.0.0.1:8068;
}
}
}
我的问题是: