Welcome! Log In Create A New Profile

Advanced

Trouble with VHosts

November 06, 2009 06:08AM
Hello,

As helpful and nice people in this mailing list seem to ignore my previous message, let's try to ask about a different problem. :-)

nginx 0.8.22
-- configure options:
[code]./configure --prefix=/u01/nginx --http-log-path=/var/log/nginx-access.log \
--http-client-body-temp-path=/u02/nginx-client-temp \
--http-proxy-temp-path=/u02/nginx-proxy-temp \
--http-fastcgi-temp-path=/u02/nginx-fcgi-temp \
--error-log-path=/var/log/nginx-error.log \
--pid-path=/var/run/nginx.pid[/code]

VHosts trouble. Supposed to be:
[list]
[*] (www.)site.com -> proxied to local Apache at 8181
[*] bs.site.com -> proxied to local Apache at 8282
[/list]

Does not work, always proxies to 8181.

I've tried like a gazillion of configurations, here's the latest one:
-------------------
[code]# ==================================
# UPSTREAMS
# ==================================
upstream main {
server localhost:8181;
}

upstream bs {
server localhost:8282;
}

# ==================================
# BANNERS
# ==================================
server {
listen 80;
server_name bs.site.com;

location / {
proxy_redirect off;
proxy_pass http://bs/;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /u01/nginx/html;
}

location ~ /\.ht {
deny all;
}

include /u01/nginx/conf/proxy.conf;
}

# ==================================
# MAIN SITE
# ==================================
proxy_cache_path /u02/nginx-cache-one levels=1:2 keys_zone=one:16m max_size=100m;
proxy_temp_path /u02/nginx-temp;

server {
listen 80;
server_name site.com www.site.com;

location /i/ {
root /u01/web/site.com/www-root/i;
access_log off;
expires 1d;
}

location /get/ {
proxy_redirect off;
proxy_cache one;
proxy_cache_valid 30s;
proxy_pass http://main/;
}

location /torrent/ {
proxy_redirect off;
proxy_cache off;
proxy_pass http://main/;
}

location / {
proxy_cache one;
proxy_cache_valid 2m;
proxy_redirect off;
proxy_pass http://main/;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /u01/nginx/html;
}

location ~ /\.ht {
deny all;
}

include /u01/nginx/conf/proxy.conf;
}[/code]
-------------------
/u01/nginx/conf/proxy.conf;
[code]
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Host $host;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 30;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
[/code]
-------------------
nginx.conf:
[code]
user nobody nogroup;
worker_processes 2;

events {
worker_connections 1024;
use epoll;
}

http {
server_name_in_redirect off;
server_tokens off;

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

sendfile on;
gzip on;
gzip_min_length 1024;
gzip_types text/plain,text/html,application/xml,application/json,application/vnd.php.serialized,text/xml,application/rss;

output_buffers 1 32k;
postpone_output 1460;

tcp_nopush on;
tcp_nodelay on;

keepalive_timeout 60;

include /u01/web/*.conf;
}
[/code]
-------------------

Please help, I'm on the edge of killing myself. :-)

--
Pavel
Subject Author Posted

Trouble with VHosts

grmbl November 06, 2009 06:08AM

Re: Trouble with VHosts

Kiswono Prayogo November 06, 2009 07:02AM

Re: Trouble with VHosts

grmbl November 06, 2009 07:07AM

Re: Trouble with VHosts

Kiswono Prayogo November 06, 2009 07:52AM

Re: Trouble with VHosts

grmbl November 06, 2009 10:42AM

Re: Trouble with VHosts

edogawaconan November 06, 2009 08:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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