NGINX没有在Ubuntu 14.04上收听端口443

时间:2016-09-10 10:28:22

标签: ubuntu nginx ubuntu-14.04

我在Ubuntu 14.04上设置了一个nginx服务器(v1.4.6)。 Nginx正在侦听端口80,但没有侦听端口443。

的输出
netstat -lpn |grep :80
tcp        0      0 0.0.0.0:80              0.0.0.0:*          
LISTEN      22333/nginx     
tcp6       0      0 :::80                   :::*                 
LISTEN      22333/nginx     

但是netstat -lpn | grep:443什么都没有显示。

以下是ufw状态的结果

ufw status
Status: active

To                         Action      From
--                         ------      ----
443                        ALLOW       Anywhere
22                         ALLOW       Anywhere
80                         ALLOW       Anywhere
3306                       ALLOW       Anywhere
8080                       ALLOW       Anywhere
443 (v6)                   ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)
80 (v6)                    ALLOW       Anywhere (v6)
3306 (v6)                  ALLOW       Anywhere (v6)
8080 (v6)                  ALLOW       Anywhere (v6)

这是我的nginx confi

server {
listen 80;

server_name node.abcd.com www.node.abcd.com;

location / {
    proxy_pass http://localhost:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}
}


server {

listen 443;
listen [::]:443 ipv6only=on;

ssl on;
ssl_certificate /etc/nginx/ssl/cert_chain.crt;
ssl_certificate_key /etc/nginx/ssl/abcd.key;


root /var/www/abcd/public/public;
index index.php index.html index.htm;

server_name abcd.com;


access_log      /var/www/abcd/log/access.log;
error_log       /var/www/abcd/log/error.log;

rewrite_log on;

 location / {
        try_files   $uri $uri/ /index.php?$query_string;
}

# Remove trailing slash to please routing system.
 if (!-d $request_filename) {
        rewrite     ^/(.+)/$ /$1 permanent;
}

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
    root /usr/share/nginx/html;
}


location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
        deny all;
}


}

0 个答案:

没有答案