2014-06-05 3 views
0

안녕하세요 저는 FastCgi를 이미 nginxproxy 서버에 설치했지만 WordPress의 관리자 패널이 열리지 않습니다/wp-admin 오류가 발생했습니다 : 찾고있는 페이지가 일시적으로 사용할 수 없습니다. 시도해보십시오. 나중에 다시.FastCGI + Wordpress + NGINX Prpxy

proxy_ignore_headers Expires Cache-Control; 
    proxy_cache_use_stale error timeout invalid_header http_502; 
    proxy_cache_bypass $cookie_session; 
    proxy_no_cache $cookie_session; 

    ## MR - increasing upload size to 64M (declare inside 'location /' not work 
    client_max_body_size 64M; 
    client_body_buffer_size 128k; 

    proxy_connect_timeout 180s; 
    proxy_send_timeout 180s; 
    proxy_read_timeout 180s; 
    #proxy_buffers 32 4k; 
    proxy_buffers 8 128k; 
    proxy_buffer_size 128k; 

    ### MR -- change enable = @wp when using wordpress 
    error_page 404 /404.html; 

    location = /404.html { 
     root '/usr/share/nginx/html'; 
    } 

    error_page 500 502 503 504 /50x.html; 

    location = /50x.html { 
     root '/usr/share/nginx/html'; 
    } 

    ### MR -- must be using nginx-special (including ngx_purge_cache) 
    location ~ /purge(/.*) { 
     ### MR -- just enough remove # below for enable 
     #proxy_cache_purge pcache "$scheme://$host$1$request_method"; 
     allow 127.0.0.1; 
     deny all; 
    } 
location ~* \.php$ { 
    fastcgi_index index.php; 
    fastcgi_pass 127.0.0.1:9000; 
    #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 
    include   fastcgi_params; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    fastcgi_param SCRIPT_NAME  $fastcgi_script_name; 
} 
    location/{ 
     limit_conn addr 25; 

     ## MR - no need try_files because permalink handle by apache 
     #try_files $uri $uri/ /index.php; 

     proxy_pass http://127.0.0.1:30080/; 

     proxy_redirect off; 

     ## MR - change $host to $domain importance for access via ip on exclusive ip domain but add X-Host still with $host 
     proxy_set_header Host $domain; 
     proxy_set_header X-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-Forwarded-For $remote_addr; 


     proxy_pass_header Set-Cookie; 

     proxy_headers_hash_max_size 512; 

     ### MR -- just enough remove # below for enable cache 
     #proxy_cache pcache; 
     proxy_cache_valid 10m; 
     proxy_cache_valid 404 1m; 

     proxy_cache_key "$scheme://$host$request_uri"; 

     proxy_cache_use_stale error timeout invalid_header 
           http_500 http_502 http_504 http_404; 

     open_file_cache max=1024 inactive=600s; 
     open_file_cache_valid 2000s; 
     open_file_cache_min_uses 1; 
     open_file_cache_errors on; 
    } 

    ### MR -- Enable this if not using nginx cache and not for wordpress 
# location ~* ^.+\.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$ { 
access_log  off; 
    log_not_found  off; 
    expires   360d; 
#  root $rootdir; 
# } 

    location ~ /\.ht { 
     deny all; 
    } 

    if (-f $request_filename) { 
     break; 
    } 

    if (-d $request_filename) { 
     break; 
    } 

Fastcgi.conf

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
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_NAME  $fastcgi_script_name; 
fastcgi_param REQUEST_URI  $request_uri; 
fastcgi_param DOCUMENT_URI  $document_uri; 
fastcgi_param DOCUMENT_ROOT  $document_root; 
fastcgi_param SERVER_PROTOCOL $server_protocol; 
fastcgi_param HTTPS    $https if_not_empty; 

fastcgi_param GATEWAY_INTERFACE CGI/1.1; 
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 

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; 

# PHP only, required if PHP was built with --enable-force-cgi-redirect 
fastcgi_param REDIRECT_STATUS 200; 

어떤 조언을 custom.proxy.conf

user nginx; 

worker_processes 2; 
worker_rlimit_nofile 1024; 

pid /var/run/nginx.pid; 

events { 
    worker_connections 2048; 

    use epoll; 
} 

http { 
    add_header Cache-Control public; 

    server_names_hash_max_size 4096; 
    server_names_hash_bucket_size 2048; 

    types_hash_bucket_size 64; 
    types_hash_max_size 2048; 

    client_header_buffer_size 2k; 
    client_header_timeout 180s; 
    client_body_timeout 180s; 
    send_timeout 180s; 
    client_max_body_size 20M; 
    client_body_buffer_size 128k; 

    sendfile  on; 
    tcp_nopush  off; 
    tcp_nodelay  on; 
    server_tokens off;  
    include '/etc/nginx/conf.d/*.conf'; 
} 

nginx.conf : 여기

내 conf의 파일입니다? 미리 감사드립니다.

답변

0

location /purge/ 이전에 error_page에 대한 부분 이후에 rewrite /wp-admin$ $scheme://$host$uri/ permanent;을 추가하십시오.

관련 문제