我已经将 Nginx 设置为我的主要 Web 服务器,并在其后面有两个基于 Mochiweb 的服务器。某些请求被反向代理到这两个服务器。现在,我想使用 nginx 访问 phpmyadmin(位于 /var/www/nginx-default/phpMyAdmin),但它一直说找不到错误 404。我在这里遗漏了一些明显的东西吗?
server {
############### General Settings ####################
listen 80;
server_name localhost;
access_log /home/me/dev/wwwaccess.log;
############## Document Root #######################
location / {
root /home/me/dev;
index index.html index.htm index.php;
}
############## PHPMyAdmin #######################
location /phpmyadmin {
root /var/www/nginx-default/phpMyAdmin;
index index.html index.htm index.php;
}
############## Proxy Settings for FastCGI Server #####
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/me/dev$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
############# Proxy Settings for Mochi1 ###############
location /mochi1 {
proxy_pass http://127.0.0.1:8000;
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;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 3600;
proxy_buffering off;
}
############# Proxy Settings for Mochi2 ###############
location /mochi2 {
proxy_pass http://127.0.0.1:8001;
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;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 3600;
proxy_buffering off;
}
############# Error redirection pages ################
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/me/dev;
}
}