-1

RoundCube と phpMyAdmin の両方に問題があります。ポート 80 でワニスを実行し、8080 で nginx を実行しています。

phpmyadmin.domain に移動してログインすると、phpmyadmin.domain:8080 にリダイレクトされます。

webmail.domain に移動してログインしようとすると、webmail.domain:8080 に移動してログインしない限り、ログイン ページがリロードされ続けます。

私が試してみました

    port_in_redirect off;

それでも 8080 が必要なようです。

phpmyadmin の Nginx 構成:

server {
    listen       8080;
    server_name  phpmyadmin.domain.name;

    port_in_redirect off; 

    access_log  /var/log/nginx/phpmyadmin.access.log;
    error_log  /var/log/nginx/phpmyadmin.error.log;

    root   /var/www/phpmyadmin.domain.name/;
    index  index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$args;
    error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\.ht {
        deny  all;
    }
}

ウェブメールの Nginx 設定:

server {
    listen      8080;
    server_name webmail.domain.name;
    root        /usr/share/roundcubemail;

    port_in_redirect off;

    # Logs
    access_log  /var/log/roundcubemail/access.log;
    error_log   /var/log/roundcubemail/error.log;

    # Default location settings
    location / {
        index   index.php;
        try_files $uri $uri/ /index.php?$args;
    }

    # Redirect server error pages to the static page /50x.html
    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
        root /var/www/html;
    }
    #error_page  404              /404.html;

    # Pass the PHP scripts to FastCGI server (locally with unix: param to avoid network overhead)
    location ~ \.php$ {
        # Prevent Zero-day exploit
        try_files $uri =404;

    fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

        fastcgi_pass    unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include         fastcgi_params;
    }

    # Deny access to .htaccess files, if Apache's document root
    location ~ /\.ht {
        deny  all;
    }

    # Exclude favicon from the logs to avoid bloating when it's not available
    location /favicon.ico {
        log_not_found   off;
        access_log      off;
    }
}
4

1 に答える 1

1

AlexeyTen が上で述べたように、php サーバー ポートが /etc/nginx/fastcgi_params の問題であり、次のように変更しました。

fastcgi_param SERVER_PORT $server_port;

に:

#fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PORT 80;

そしてそれは私の問題を解決しました!

于 2015-03-06T00:45:49.673 に答える