为什么我在我的http / https nginx设置中为我的index.page获得一个404?

我正在使用WPN-XM (与Nginx,MariaDB,PHP和OPENSSL堆栈),并试图在HTTP/HTTPS服务器中设置OpenSSL 。 我在这里按照NGINX的指示,我的服务器启动/停止没有错误。

这是我的nginx.conf与“双服务器”:

 server { listen 80; listen 443 ssl; server_name localhost; root www/login; # ssl properties ssl_certificate ../../../bin/openssl/certs/cert.pem; ssl_certificate_key ../../../bin/openssl/certs/cert.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; log_not_found off; charset utf-8; access_log logs/access.log main; # handle files in the root path /www location / { index index.php index.html index.htm; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root www; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9100 # location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9100; fastcgi_index index.php; fastcgi_param HTTPS on; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } 

这是基本的WPN-XMconfiguration(参见这里 ),修改后的服务器包含一个用于443的侦听器以及SSL属性。

我可以从http://localhost/foo/index.html访问我的页面,但是当试图从httpS://localhost/foo/index.html访问它时,我得到一个404。

题:
第一个下午与Nginx。 有人能指点我做错了什么吗?

谢谢!

你的root指令应该使用绝对path。 预测他们将尝试从相对path读取文件的位置并不容易。