Welcome! Log In Create A New Profile

Advanced

Re: httptunnel and nginx

January 17, 2011 05:47AM
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.

Thanks in advance.
Subject Author Posted

httptunnel and nginx

barmic January 10, 2011 11:45AM

Re: httptunnel and nginx

António P. P. Almeida January 10, 2011 12:32PM

Re: httptunnel and nginx

barmic January 11, 2011 01:53AM

Re: httptunnel and nginx

barmic January 17, 2011 05:47AM

Re: httptunnel and nginx

barmic January 18, 2011 02:43AM

Re: httptunnel and nginx

vesperto January 17, 2011 06:00AM

Re: httptunnel and nginx

António P. P. Almeida January 17, 2011 09:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 217
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready