Welcome! Log In Create A New Profile

Advanced

Proxy Websockets: 499 & 504s

Posted by ClaudiuT 
Proxy Websockets: 499 & 504s
October 05, 2015 09:13AM
Greetings!

I am trying to use NGINX to:

1) Serve static content (working as expected)

2) Proxy dynamic content to fastcgi mono (working as expected)

3) Proxy webSockets (using XSockets as a wrapper) to port 4502 (not working as expected)

I am getting 499 (client closed the connection before the server answered the request) Error - NGINX specific - for a minute;

and 504s afterwards: Gateway time-out error.

I don't believe there's any need to increase keepalive_timeout, since it should normally not need more than a couple of seconds to its thing.
I've tried all I could find on the internets, but haven't managed to solve this issue.

Do you think this is how it should be done and something might be wrong in the application?

Any tips are more than welcome and will be rewarded with lots of gratitude :)
_________
nginx.conf: |
______________________________________________________________________________________________________________________

##user www-data;
worker_processes 1;
pid /home/calnex/nginx.pid;

events {
worker_connections 64;
}

http {
##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

include mime.types;
default_type application/octet-stream;

##
# Logging Settings
##

access_log /opt/var/log/nginx/access.log;
error_log /opt/var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

##
# Virtual Host Configs
##

include sites-enabled/*;

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
}
______________________________________________________________________________________________________________________

_________________
sites-enabled/endor:|
______________________________________________________________________________________________________________________

server {
# The port the site is listening on
listen 8000;

root /opt/lib/endor/;
client_max_body_size 100M;

# Serving static files
location ~ .*\.(js|css|png|jpg|jpeg|gif|tif)?$ {
expires modified 7d;
add_header Cache-Control "public";
}

# Trying to proxy WebSockets
location /Realtime {
proxy_pass http://127.0.0.1:4502;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;

# I have tried these
# tcp_nodelay on;
# fastcgi_read_timeout 300;
# proxy_read_timeout 300;
# access_log off;
# proxy_ignore_client_abort on;
# fastcgi_keep_conn on;
}

# Proxying dynamic content
location / {
fastcgi_pass unix:/opt/tmp/mono-fcgi.sock;
include fastcgi_params;
}
}
______________________________________________________________________________________________________________________



Edited 3 time(s). Last edit at 10/05/2015 09:18AM by ClaudiuT.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 100
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready