Welcome! Log In Create A New Profile

Advanced

Re: Proxying based on protocol (e.g. "ws"/"wss")?

Daniel Griscom
May 10, 2013 02:36PM
That's great information, but now I need to figure out how to
selectively proxy to my websocket backend when $http_upgrade is
"websocket". I see the following choices:

1) Have nginx listen at port 80, and proxy all traffic to port XXXX
if $http_upgrade is "websocket", or port YYYY if not. Then set up
nginx to handle http traffic at port YYYY, and have my websocket
backend handle websocket traffic at port XXXX.

2) Investigate the much-maligned "if" statement.


.... any other choices? Thoughts?


Thanks,
Dan


At 1:26 PM +0400 5/10/13, Maxim Dounin wrote:
>Hello!
>
>On Fri, May 10, 2013 at 09:14:04AM +1200, Steve Holdoway wrote:
>
>> The scheme is available as... $scheme
>
>Yes, but WebSocket protocol uses http for handshake. So the
>scheme will be either "http" or "https". WebSocket requests can
>be identified based on Upgrade header, i.e. $http_upgrade
>variable.
>
>>
>> On Thu, 2013-05-09 at 14:45 -0400, Daniel Griscom wrote:
>> > ... bump?
>> >
>> > (thanks,
>> > Dan)
>> >
>> >
>> > At 9:32 AM -0400 5/8/13, Daniel Griscom wrote:
>> > >I'm an nginx newbie, and need use use it as a front end for a
>> > >website that also handles websocket connections. I have the
>> > >configuration set up so that requests to a specific URI match a
>> > >location section, which then proxies the request to the websocket
>> > >back end server, and it all works. (Very cool.)
>> > >
>> > >However, I was wondering if, rather than detecting requests to a
>> > >specific location, I could proxy all "ws://" or "wss:// requests,
>> > >independent of the URI being requested.
>> > >
>> > >Is there a way to proxy all requests with a given protocol?
>> > >
>> > >
>> > >Thanks,
>> > >Dan
>> > >
>> > >--
>> > >Daniel T. Griscom griscom@suitable.com
>> > >Suitable Systems http://www.suitable.com/
>> > >1 Centre Street, Suite 204 (781) 665-0053
>> > >Wakefield, MA 01880-2400
>> > >
>> > >_______________________________________________
>> > >nginx mailing list
>> > >nginx@nginx.org
>> > >http://mailman.nginx.org/mailman/listinfo/nginx
>> >
>> >
>>
>> --
>> Steve Holdoway BSc(Hons) MNZCS <steve@greengecko.co.nz>
>> http://www.greengecko.co.nz
>> MSN: steve@greengecko.co.nz
>> Skype: sholdowa
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>
>--
>Maxim Dounin
>http://nginx.org/en/donation.html
>
>_______________________________________________
>nginx mailing list
>nginx@nginx.org
>http://mailman.nginx.org/mailman/listinfo/nginx


--
Daniel T. Griscom griscom@suitable.com
Suitable Systems http://www.suitable.com/
1 Centre Street, Suite 204 (781) 665-0053
Wakefield, MA 01880-2400

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxying based on protocol (e.g. "ws"/"wss")?

Daniel Griscom May 08, 2013 09:34AM

Re: Proxying based on protocol (e.g. "ws"/"wss")?

Daniel Griscom May 09, 2013 02:48PM

Re: Proxying based on protocol (e.g. "ws"/"wss")?

GreenGecko May 09, 2013 05:16PM

Re: Proxying based on protocol (e.g. "ws"/"wss")?

Maxim Dounin May 10, 2013 05:28AM

Re: Proxying based on protocol (e.g. "ws"/"wss")?

Daniel Griscom May 10, 2013 02:36PM

Re: Proxying based on protocol (e.g. "ws"/"wss")?

Maxim Dounin May 11, 2013 11:02AM

Re: Proxying based on protocol (e.g. "ws"/"wss")?

Daniel Griscom May 11, 2013 11:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 109
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