I have a simple nginx configuration playing as a proxy to handle ssl requests.
The problem is when I log on phpmyadmin on https://files.mysite.com/phpmyadmin
, it redirects me on http://files.mysite.com:443
and throw a :
400 Bad request: The plain HTTP request was sent to HTTPS port
I've looked around here and on super user and can't find anything that would fit this problem
Here's the nginx configuration file :
server {
listen 0.0.0.0:80;
server_name files.mysite.com;
return 301 https://files.mysite.com$request_uri;
}
server {
listen 0.0.0.0:443 ssl;
server_name files.mysite.com;
ssl on;
ssl_certificate /etc/letsencrypt/live/files.mysite.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/files.mysite.com/privkey.pem;
root /home/mysite/mysite.com/files;
index index.html;
location ^~ /phpmyadmin {
root /usr/share/;
index index.php;
include conf-available/php5.conf;
}
}
I am using almost the same configuration on all subdomains with various web tools and no problem, so I am really confused !
Thanks for helping !
EDIT: I've been asked to show the output of wget -S files.mysite.com
so here it is
And, apprently, it is well redirected from http:80 to https:443 but then switchs back to http:443 for some reason
EDIT2: Actually it's not redirecting to http:443 when wget -S
, this is only achievied when I successfully log into phpmyadmin