Chào mọi người!
Mình cài Vestacp: nginx + phpfpm
Để tránh lỗi 404 page not found, mình thiết lập Nginx rewrite rules như bên dưới. Tuy nhiên sau đó thì ip/webmail/ lại không load đc. Có bạn nào biết cách sử lý vấn đề Nginx rewrite rules và webmail thì chỉ mình với.
client_max_body_size 5G;
# allow for paths ending with forward slashes
rewrite ^/app/(.*)/ /plugins/webdav/site/control/$1 last;
rewrite ^/app/(.*) /plugins/webdav/site/control/$1 last;
# all webdav requests
location /plugins/webdav/site/control/ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
gzip off;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
include fastcgi_params;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
include fastcgi_params;
}
#location / {
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?_page_url=$1 last;
}
#}
location /files/ {
internal;
}
# these locations would be hidden by .htaccess normally
location /core/logs/ {
deny all;
}