Welcome! Log In Create A New Profile

Advanced

Связка nginx-apache в качестве прокси

June 04, 2014 07:54AM
Здравствуйте!
Подскажите пожалуйста, на сайте domain.ru с ip 1.1.1.1 стоял apache 2.2 и Joomla 1.5 и в конфиге были такие строки

ProxyRequests On
ProxyVia Block
AllowCONNECT 21 25 110 443 22 554 563 5190 1080 8080 5140 5160 4000 1478 1479 1480 8008 1480>

<Proxy *>
Order deny,allow
deny from all
allow from xxx.xx.xx.xx
</Proxy>

Апач работал, как прокси, в настрйоках брайзера был прописан ip сайта и 80 порт.
Но после переезда на Joomla 2.5 увеличилась нагрузка и возникла необходимость поставить nginx.
nginx поставил, но отпал функционал прокси. Конфиг nginx прилагается.
# user nginx;
worker_processes 4;
timer_resolution 100ms;

# error_log /dev/null;
error_log /usr/local/nginx/logs/error.log crit;
#pid logs/nginx.pid;
worker_rlimit_nofile 200000;
worker_priority -5;
events { worker_connections 4000;

multi_accept on; }
http { include mime.types; default_type application/octet-stream;
types { text/plain data; }
log_format main '$remote_addr - $remote_user [$time_local] $host $request
'
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_src_client_ip"';

#access_log /usr/local/nginx/logs/access.log main;
access_log off;

# Caches information about open FDs, freqently accessed files.
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;


sendfile on;
tcp_nopush on;
tcp_nodelay on;

gzip on;
gzip_min_length 10240;
gzip_buffers 64 8k;
gzip_comp_level 3;
gzip_http_version 1.1;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plan application/xml application/x-javascript text/css text/xml text/javascript;
gzip_disable "msie6";
client_body_timeout 10;
client_header_timeout 10;
send_timeout 2;

keepalive_timeout 30;
keepalive_requests 1000;

server_tokens off;
server_names_hash_bucket_size 64;
proxy_buffers 100 64k;
proxy_read_timeout 300;
proxy_send_timeout 300;
client_max_body_size 1500m;
reset_timedout_connection on;

proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=one:16m inactive=7d max_size=1024m;
proxy_temp_path /var/cache/nginx/temp;

server {
listen *:80;
server_name *.com;
location /nginx_status { stub_status on; access_log off; allow 1.1.1.1; deny all; }
location /munin { alias /var/www/html/munin; autoindex on; auth_basic "Munin"; auth_basic_user_file /etc/munin/munin-htpasswd; }
location / {
proxy_pass http://1.1.1.1:8181;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}

}

server {
listen *:80;
server_name www.domain.ru domain.ru;
location /nginx_status { stub_status on; access_log off; allow 1.1.1.1; deny all; }
location /munin { alias /var/www/html/munin; autoindex on; auth_basic "Munin"; auth_basic_user_file /etc/munin/munin-htpasswd; }
# proxy_temp_path /var/cache/nginx/domain.ru;

location / {
# $host='domain.ru:80'
proxy_pass http://1.1.1.1:80;
proxy_set_header Host domain.ru;
proxy_redirect off;
}

# location /administrator {
location ~*(administrator|comprofiler)* {
proxy_cache off;
proxy_pass http://1.1.1.1:8181;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;

}

}
}



Сейчас нужно вернуть возможность использовать связку nginx-apache в качестве прокси. На сервере открыт только 80 и 22 порты, других не будет. Подскажите, как вернуть функционал прокси?
Subject Author Posted

Связка nginx-apache в качестве прокси

Magi June 04, 2014 07:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 68
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready