1
我已經安裝了我的證書並配置了我的nginx來偵聽端口443.但是仍然無法連接到端口443.錯過了什麼?安裝ssl證書Nginx端口443拒絕連接
在我的ssl.conf
HTTPS服務器配置
#
server {
listen 443 ssl;
server_name www.newbullets.co.nz newbullets.co.nz;
ssl on;
ssl_certificate /etc/ssl/certs/ssl-bundle.crt;
ssl_certificate_key /etc/ssl/server.key;
ssl_session_timeout 5m;
#location/{
# root html;
# index index.html index.htm;
#}
}
和default.config
server {
listen 80;
server_name newbullets.co.nz www.newbullets.co.nz;
#charset koi8-r;
#access_log logs/host.access.log main;
location/{
auth_basic "input you user name and password";
auth_basic_user_file /var/www/www.newbullets.co.nz/.htpasswd;
root /usr/share/nginx/html/nb/;
index index.html index.htm index.php;
try_files $uri $uri/ @handler;
}
更新
我將以下內容添加到我的ssl.conf中,現在在Firefox中顯示網頁,但SSL綠色欄消失,Chrome仍下載網頁。任何想法?
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/nb$fastcgi_script_name;
fastcgi_param MAGE_RUN_CODE default;
fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params;
}
它現在的工作,但一個問題是,當我指向HTTPS URL下載它的index.php文件,而不是顯示的網頁,在我的ssl.conf位置指令我有{index index.html index.htm index.php; root/usr/share/nginx/html/nb /;}任何想法? – user1883793
你有沒有安裝和配置php-fpm?我沒有看到一個指向php-fpm後端的fastcgi_index。這可能有所幫助:http://www.rackspace.com/knowledge_center/article/installing-nginx-and-php-fpm-setup-for-nginx –
您好,請參閱我的更新我添加了php位置指令到我的配置和Firefox現在顯示網頁,但瀏覽器的SSL綠色欄消失了,Chrome仍然下載了網頁 – user1883793