httptunnel and nginx

António P. P. Almeida appa at perusio.net
Mon Jan 17 16:57:28 MSK 2011


On 17 Jan 2011 10h47 WET, nginx-forum at nginx.us wrote:

> Hello,
>
> I finally choice to use nginx only as reverse proxy, but I don't
> find how transfer a connection to another port. I have hts that
> listen on 0.0.0.0:8081 of my server and I want that when I launch
> htc on port 80 of the virtual subdomain ssh.barmic.fr, nginx
> transfer the connection to 127.0.0.1:8081. This is my new
> configuration : /etc/nginx/site-available/default [code] upstream
> default { server 127.0.0.1:8080; }
>
> upstream java {
> server 127.0.0.1:8081;
> }
>
> upstream tunnel {
> server 127.0.0.1:8082;
> }
>
> server {
> 	listen   80;
> 	server_name  *.barmic.fr;
>
> 	access_log  /var/log/nginx/barmic.fr.access.log;
>
> location / {
> proxy_pass http://default;
> }
> }
>
> server {
> 	listen   80;
> 	server_name  ssh.barmic.fr;
>
> 	access_log  /var/log/nginx/ssh.barmic.fr.access.log;
>
> location / {
> proxy_pass http://tunnel;
> }
> }
>
> server {
> 	listen   80;
> 	server_name  java.barmic.fr;
>
> 	access_log  /var/log/nginx/java.barmic.fr.access.log;
>
> location / {
> proxy_pass http://java;
> }
> }
> [/code]
> and /etc/nginx/nginx.conf (don't touch by me) :
> [code]
> user www-data;
> worker_processes  1;
>
> error_log  /var/log/nginx/error.log;
> pid        /var/run/nginx.pid;
>
> events {
> worker_connections  1024;
> }
>
> http {
> include       /etc/nginx/mime.types;
> default_type  application/octet-stream;
>
> access_log	/var/log/nginx/access.log;
>
> sendfile        on;
> #tcp_nopush     on;
>
> #keepalive_timeout  0;
> keepalive_timeout  65;
> tcp_nodelay        on;
>
> gzip  on;
>
> include /etc/nginx/conf.d/*.conf;
> include /etc/nginx/sites-enabled/*;
> }[/code]
>
> I use nginx on version 0.6.32 on Debian Lenny.

In case you're interested in a 0.9.3 compiled for debian unstable
without SSI, WebDAV and Mail. With AIO, upload progress and upstream
fair.

http://debian.perusio.net (instructions included).

Of course you can grab the source package and build it yourself (YMMV,
I've never tried that -- I run a mixed lenny/squeeze/sid).

HTH,
--- appa




More information about the nginx mailing list