【发布时间】:2015-06-23 08:33:13
【问题描述】:
我无法使用当前的nginx 配置连接到phpmyadmin。
/etc/nginx/sites-enabled/couponmonk_project
server {
error_log /var/log/nginx/error.log debug;
access_log /var/log/nginx/access.log;
location / {
proxy_pass http://localhost: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;
}
location /static {
alias /home/giri/couponmonk_project/couponmonk_project/static;
}
location /phpmyadmin {
root /usr/share/nginx/www;
index index.html index.htm index.php;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /socket.io {
proxy_pass http://localhost:8000/socket.io;
proxy_redirect off;
proxy_buffering 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;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
当我尝试使用my_ip_address/phpmyadmin 访问phpmyadmin 时,我收到404 Not Found 错误。我的其他路径似乎运行良好。
文件夹/usr/share/nginx/www/phpmyadmin 包含index.php 文件。作为快速测试,我在此处插入了一个index.html 文件,它已正确显示。
和fastcgi_params 有关系吗?我不确定如何/是否应该编辑此文件。
任何关于我应该尝试什么的想法将不胜感激。
【问题讨论】:
标签: nginx phpmyadmin