привет у меня проблема с nginx,nginx скачивает php файлы.у меня сервер под cent OS 6.3. я использую webmin.вот это config файл :
#user nginx nginx;
user apache;
worker_processes 3;
worker_rlimit_nofile 8192;error_log /var/log/nginx/error_log info;
events {
worker_connections 2048;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main
'$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
log_format apache
'$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access_log apache; # buffer=32k;
client_header_timeout 10;
client_body_timeout 10;
send_timeout 30;
keepalive_timeout 40 20;
connection_pool_size 256; # 8192;
client_header_buffer_size 1k;
large_client_header_buffers 4 2k;
request_pool_size 4k;
## Compression ##
gzip on;
gzip_comp_level 4;
gzip_min_length 1100;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; # text/plain
gzip_buffers 16 8k;
output_buffers 8 32k;
## Performance ##
sendfile off; # on;
tcp_nopush on;
tcp_nodelay on;
postpone_output 0; # 1460;
## Security ##
# server {
# server_name _;
# return 444;
# }
server_tokens off;
ignore_invalid_headers on;
server_name_in_redirect off;
limit_zone myzone $binary_remote_addr 10m;
proxy_cache_path /dev/shm/cache levels=1:2 keys_zone=pcache:500m max_size=550m inactive=600m;
proxy_temp_path /dev/shm/tmp;
upstream backpool_g {
server ww.my_site_name.com:80 max_fails=0;
}
server {
limit_conn myzone 10;
listen 8088;
server_name default;
client_max_body_size 3m;
# Only allow
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
## Proxy setup
proxy_ignore_headers Expires;
proxy_ignore_headers Cache-Control;
proxy_ignore_headers Set-Cookie;
proxy_hide_header Set-Cookie;
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_connect_timeout 5;
proxy_send_timeout 10;
proxy_read_timeout 15;
proxy_redirect off;
proxy_cache_use_stale error timeout updating;
# proxy_cache_key "$scheme$proxy_host$request_uri$slangu";
proxy_cache_min_uses 1;
proxy_cache_valid 200 301 302 5m;
# proxy_cache_valid 404 1m;
#
root /home/my_site_name/public_html;
index index.php index.html index.htm;
# don't cache but all proxy cmsadmin files
# location /cmsadmin {
# client_max_body_size 16m;
# proxy_pass http://backpool_g;
# proxy_redirect off;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# }
# cache for a while jpg,png,etc..
#
location ~* \./(jpg|png|gif|css|js|swf|flv|ico)$ {
expires 30d;
}
location / {
try_files $uri $uri/ @handler;
expires 30d;
}
# this will catch everything that is not acctually a file but is not ending with php i say cache it and serve it hot
location @handler {
proxy_pass http://backpool_g;
proxy_cache pcache;
}
location ~ ^/(index|psql)\.php {
# rewrite ^/articleid/(.*)$ /article.php?id=$1;
# rewrite ^/newsid/(.*)$ /index.php?newsid=$1;
# if ($http_cookie ~* "lang=(.*)" ) {
# set $slangu $1;
# }
proxy_pass http://backpool_g;
proxy_cache pcache;
}
location ~ \.php$ {
if (!-e $request_filename) {
rewrite / /index.php last;
}
proxy_pass http://backpool_g;
# proxy_pass http://localhost:82;
}
}
# server {
# listen 127.0.0.1;
# server_name localhost;
# access_log /var/log/nginx/localhost.access_log main;
# error_log /var/log/nginx/localhost.error_log info;
# root /var/www/localhost/htdocs;
# }
# SSL example
#server {
# listen 127.0.0.1:443;
# server_name localhost;
# ssl on;
# ssl_certificate /etc/ssl/nginx/nginx.pem;
# ssl_certificate_key /etc/ssl/nginx/nginx.key;
# access_log /var/log/nginx/localhost.ssl_access_log main;
# error_log /var/log/nginx/localhost.ssl_error_log info;
# root /var/www/localhost/htdocs;
#}
server_names_hash_bucket_size 128;
server {
server_name my_site_name.com www.my_site_name.com;
listen 192.168.1.34;
root /home/my_site_name/public_html;
access_log /var/log/virtualmin/my_site_name.com_access_log;
error_log /var/log/virtualmin/my_site_name.com_error_log;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/my_site_name/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/my_site_name/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
location = \.php$ {
try_files $uri =404;
fastcgi_pass localhost:9000;
root /home/my_site_name/public_html/;
}
}
}
help me plz