OPNsense Forum

English Forums => General Discussion => Topic started by: park0kyung0won on February 25, 2019, 10:54:20 PM

Title: NGINX: Connection gets dropped
Post by: park0kyung0won on February 25, 2019, 10:54:20 PM
Hello

I am using NGINX on latest version of OPNSense production distro
Problem I've encountered is, seems like connection is being dropped
after certain amount of time.

I was using openstack-dashboard behind the OPNSense NGINX,
which requires websocket for displaying VNC on web.

Should I explicitly set some options for keeping connection alive?
Title: Re: NGINX: Connection gets dropped
Post by: fabian on February 25, 2019, 11:21:23 PM
Do you need a timeout option?
Title: Re: NGINX: Connection gets dropped
Post by: park0kyung0won on February 26, 2019, 09:36:33 AM
I'm not sure that will fix (I don't have enough knowledge)
I've made some multiplayer web game app which uses websocket
but connection gets dropped after certain amount of time (like 2 mins?...)

I need to dig it down further I guess
For now, not 100% sure it's NGINX problem or firewall itself
Could you give me some advice for inspection? I'll start with wireshark

If it's firewall, I'm suspecting "Schedule States" option (Currently not checked) in
"Firewall" -> "Settings" -> "Advanced" tab...
Can firewall or NGINX somehow wipe active connection(websocket traffic of game) somehow?
Title: Re: NGINX: Connection gets dropped
Post by: park0kyung0won on February 26, 2019, 10:49:04 AM
Quote from: fabian on February 25, 2019, 11:21:23 PM
Do you need a timeout option?
I got websocket error code 1006
https://stackoverflow.com/questions/19304157/getting-the-reason-why-websockets-closed-with-close-code-1006

Seems like it's not a firewall issue
Title: Re: NGINX: Connection gets dropped
Post by: park0kyung0won on February 26, 2019, 11:11:51 AM
Quote from: fabian on February 25, 2019, 11:21:23 PM
Do you need a timeout option?

I suspect this the most
https://github.com/abingham/runner_repl/issues/7

He says "proxy_read_timeout" and "proxy_send_timeout" should be configured differently than default 60s value
Title: Re: NGINX: Connection gets dropped
Post by: park0kyung0won on February 26, 2019, 11:25:14 AM
Quote from: park0kyung0won on February 26, 2019, 11:11:51 AM
Quote from: fabian on February 25, 2019, 11:21:23 PM
Do you need a timeout option?

I suspect this the most
https://github.com/abingham/runner_repl/issues/7

He says "proxy_read_timeout" and "proxy_send_timeout" should be configured different from the default value which is 60s


Title: Re: NGINX: Connection gets dropped
Post by: fabian on February 26, 2019, 08:53:23 PM
I made a ticket: https://github.com/opnsense/plugins/issues/1210
Title: Re: NGINX: Connection gets dropped
Post by: park0kyung0won on February 27, 2019, 01:52:28 AM
Quote from: fabian on February 26, 2019, 08:53:23 PM
I made a ticket: https://github.com/opnsense/plugins/issues/1210
Thank you
Is there any way I can manually override nginx.conf temporarily before update arrives?
Title: Re: NGINX: Connection gets dropped
Post by: newsense on February 27, 2019, 03:30:25 AM
Once a patch will be available you'll be able to test it before it's rolled out.

For the time being however, it's still a bug.
Title: Re: NGINX: Connection gets dropped
Post by: fabian on February 27, 2019, 07:17:31 PM
For the timeouts, the patch can be installed using the following id: e8a8ed0ad832da64a79abf49ef45118b07267c4a

https://github.com/opnsense/plugins/pull/1211/files
Title: Re: NGINX: Connection gets dropped
Post by: newsense on February 28, 2019, 07:13:58 AM
opnsense-patch e8a8ed0ad832da64a79abf49ef45118b07267c4a
:)
Title: Re: NGINX: Connection gets dropped
Post by: park0kyung0won on February 28, 2019, 07:45:28 AM
Quote from: fabian on February 27, 2019, 07:17:31 PM
For the timeouts, the patch can be installed using the following id: e8a8ed0ad832da64a79abf49ef45118b07267c4a

https://github.com/opnsense/plugins/pull/1211/files

Thanks!!
Title: Re: NGINX: Connection gets dropped
Post by: park0kyung0won on February 28, 2019, 08:01:08 AM
Quote from: newsense on February 28, 2019, 07:13:58 AM
opnsense-patch e8a8ed0ad832da64a79abf49ef45118b07267c4a
:)

OPNSense says...
fetch: https://github.com/opnsense/core/commit/e8a8ed0ad832da64a79abf49ef45118b07267c4a.patch: Not Found
What should I do?...  :'(

------------------------------------------------------------------
I've figured it out! opensense-patch -c plugins worked
Title: Re: NGINX: Connection gets dropped
Post by: fabian on February 28, 2019, 06:00:32 PM
you need to add the switch for the plugins repository (probably -c plugins).