Nginx port_in_redirect nicht funktioniert?

Ich habe vor kurzem eingerichtet einen Nginx server zu hosten eines wordpress installieren und bin mit Varnish als reverse-proxy vor dem server. Der Lack läuft auf port 80, also ich habe bis Nginx zu hören, zu 80 und umleiten. Leider bei der Umleitung der port 8080 an die nginx Anfrage.

Einschließlich port_in_redirect off scheint die Allgemeine Lösung für dieses problem, aber es scheint nicht zu funktionieren für mich. Ich habe befestigt die /sites-enabled/default config unten. Mache ich etwas falsch?! Die php-Weiterleitung scheint zu funktionieren, es ist nur bei location /wo es scheitert.

/sites-enabled/default:

server { 
    listen 8080 default;
    server_name "" xxx.xxx.xxx.xxx;  #just using IP here (no domain yet)

    port_in_redirect off;
    server_name_in_redirect off;

    access_log  /var/log/nginx/localhost.access.log;


    location /{
            root   /var/www/site/html/;
            index  index index.php;
            try_files $uri/$uri /index.php?q=$uri&$args;
    }

    location ~ .php$ {
            fastcgi_split_path_info ^(.+.php)(.*)$;
            fastcgi_pass   backend;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/site/html/$fastcgi_script_name;
            include fastcgi_params;
            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_intercept_errors        on;
            fastcgi_ignore_client_abort     off;
            fastcgi_connect_timeout 60;
            fastcgi_send_timeout 180;
            fastcgi_read_timeout 180;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 4 256k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
            fastcgi_param SERVER_PORT 80;
    }

    location ~ /.ht {
        deny  all;
    }
    location ~ /.git {
        deny  all;
    }
    location ~ /.svn {
        deny  all;
    }

}

upstream backend {
    server 127.0.0.1:9000;
}

nginx.conf:

user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log debug;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    multi_accept on; 
}

http {
    include       /etc/nginx/mime.types;

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    tcp_nopush     off;

    keepalive_timeout  30;
    tcp_nodelay        on;

    gzip  on;
    gzip_proxied any;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
    gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

nginx: nginx-version: nginx/1.0.9

InformationsquelleAutor olan | 2011-11-06
Schreibe einen Kommentar