phpmyadmin, nginx, ssl and https
Posted by jianyu
on Apr 25, 2010
Several problems resolved:
1. Jump to http 80 after login, not https.
2. Jump to https://test.com/index.php, not https://test.com/phpmyadmin/index.php after login.
3. Static content location.
Below is my sample configuration:
server {
listen 443;
server_name test.com;
access_log /var/log/nginx/phpmyadmin/access.log;
error_log /var/log/nginx/phpmyadmin/error.log;
ssl on;
ssl_certificate /root/ssl.cer;
ssl_certificate_key /root/ssl.key;
root /var/www/nginx-default;
location / {
index index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location /phpmyadmin {
root /usr/share;
index index.php;
}
location ~ /phpmyadmin/.+\.php$ {
root /usr/share;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include /etc/nginx/fastcgi_params;
}
}