rendered paste bodyuser 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;
client_max_body_size 20m;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
upstream mongrel {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
}
server {
listen 217.195.210.114:80;
server_name www.tyu.ru;
location / {
if ($host != 'www.tyu.ru' ) {
rewrite ^/(.*)$ http://www.tyu.ru/$1 permanent;
}
proxy_pass http://mongrel;
}
location /stream/ {
rewrite ^/stream/(.*)$ /$1 break;
proxy_pass http://217.195.217.122:8080;
}
location /protected/ {
internal;
alias /home/nir0/tyuport/uploads/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {#СТАРЫЙ
listen 217.195.217.122:80;
server_name www.tyu.ru;
location / {
if ($host != 'www.tyu.ru' ) {
rewrite ^/(.*)$ http://www.tyu.ru/$1 permanent;
}
proxy_pass http://mongrel;
}
location /stream/ {
rewrite ^/stream/(.*)$ /$1 break;
proxy_pass http://217.195.217.122:8080;
}
location /protected/ {
internal;
alias /home/nir0/tyuport/uploads/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 217.195.210.114:80;
server_name icons.tyu.ru;
location / {
root /home/nir0/tyuport/public/icons;
if (!-f $request_filename) {
rewrite ^(.*)$ /empty.gif last;
break;
}
}
error_page 404 =200 /empty.gif;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {#СТАРЫЙ
listen 217.195.217.122:80;
server_name icons.tyu.ru;
location / {
root /home/nir0/tyuport/public/icons;
if (!-f $request_filename) {
rewrite ^(.*)$ /empty.gif last;
break;
}
}
error_page 404 =200 /empty.gif;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
include /etc/nginx/sites-enabled/*;
# server {
# listen 80;
# server_name www.tyuport.ru;
# #charset koi8-r;
#
# #access_log logs/host.access.log main;
#
# location / {
# proxy_pass http://mongrel;
# }
# location /protected/ {
# internal;
# alias /home/nir0/tyuport/uploads/;
# }
#
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root html;
# }
# }
include /etc/nginx/sites-enabled/*;
}