Здравствуйте!
Подскажите пожалуйста, когда стоял просто apache 2.2 и в конфиге были такие строки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>
Апач работал, как прокси. Но возникла необходимость поставить nginx.
Теперь прокси перестал работать.
Как можно вернуть этот функционал?
Ниже конфиг nginx
# user nginx;
worker_processes 4;
# error_log /dev/null;
error_log /usr/local/nginx/logs/error.log notice;
#pid logs/nginx.pid;
worker_rlimit_nofile 500000;
worker_priority -5;
events { worker_connections 200000; 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;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
keepalive_timeout 0;
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=10>
proxy_temp_path /var/cache/nginx/temp;
server {
listen *:80;
server_name *.com;
location /nginx_status { stub_status on; access_log off; allow 195.34.232.172; deny all; }
location /munin { alias /var/www/html/munin; autoindex on; auth_basic "Munin"; auth_basic_>
location / {
proxy_pass http://195.34.232.172: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.recipe.ru recipe.ru;
location /nginx_status { stub_status on; access_log off; allow 195.34.232.172; deny all; }
location /munin { alias /var/www/html/munin; autoindex on; auth_basic "Munin"; auth_basic_>
# proxy_temp_path /var/cache/nginx/recipe.ru;
location / {
proxy_pass http://195.34.232.172: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;
proxy_cache one;
proxy_cache_key "$request_method|$is_args|$host|$request_uri";
proxy_hide_header "Set-Cookie";
proxy_ignore_headers "Cache-Control" "Expires" "Set-Cookie" "X-Accel-Expires" "X-Accel-Redir>
# proxy_ignore_headers "Cache-Control" "Expires" "X-Accel-Expires" "X-Accel-Redirect";
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
proxy_cache_valid any 10s;
proxy_cache_use_stale http_502 http_503 http_504;
proxy_cache_bypass $cookie_session $http_x_update;
}
# location /administrator {
location ~*(administrator|comprofiler)* {
proxy_cache off;
proxy_pass http://195.34.232.172: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;
}
}
}