Welcome! Log In Create A New Profile

Advanced

SSL config problems : wrong root for https requests

Posted by shinmaikeru 
SSL config problems : wrong root for https requests
January 08, 2014 02:20AM
The HTTPS request
https://www.xxx.jp/tida/test.jpg
is being interpreted as
/usr/share/nginx/html/tida/test.jpg
in
2014/01/08 15:38:27 [error] 29388#0: *90 open()
"/usr/share/nginx/html/tida/test.jpg" failed (2: No such file or
directory), client: xx.xx.xx.xx, server: www.xxx.jp, request: "GET
/tida/test.jpg HTTP/1.1", host: "www.xxx.jp"

The HTTP request
http://www.xxx.jp/tida/test.jpg
Is being interpreted as
/var/nginx/tida/test.jpg
In
xx.xx.xx.xx - - [08/Jan/2014:15:38:27 +0900] "GET /tida/test.jpg HTTP/1.1"
404 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:26.0)
Gecko/20100101 Firefox/26.0"


So it looks like nginx is correctly recognizing the root directory of
/var/nginx/
For http but not for https, because https requests are being given root of
/usr/share/nginx/html/

The conf file contains
include /etc/nginx/conf.d/*.conf;

and the ssl.conf file is
server {
listen 443 ssl;
server_name www.xxx.jp;

ssl_certificate /etc/ssl/certs/www.xxx.jp.cer;
ssl_certificate_key /etc/ssl/certs/www.xxx.jp.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
root /var/nginx/;
location / {
root html;
index index.html index.htm;
}
}

I think the root directive is not being processed. How can I get nginx to do HTTPS correctly?
Re: SSL config problems : wrong root for https requests
January 08, 2014 02:38AM
Co-worker solved it for me.

The person who set it up put

root /var/nginx/;
location / {
root html;
index index.html index.htm;
}

and that had to be commented out

root /var/nginx/;
location / {
# root html;
index index.html index.htm;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready