server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name _;
root /var/www/html/public/;
ssl_certificate "/etc/pki/nginx/server.pem";
ssl_certificate_key "/etc/pki/nginx/server.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location ~ \.php$ {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
fastcgi_pass_request_body off;
client_body_in_file_only clean;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
}
nginx版本是1.10.2,80端口forbidden,433打不开
把监听那部分修改一下
listen 80;
listen 443 ssl;
记得备份一下,nginx -t 看一下是否正确,然后重启nginx,应该就可以了
话说,兄弟你应该贴日志上来看看,不过感觉你应该是权限问题,如果listen 443的www路径木有问题的话,在nginx配置文件最上面加上 user root;重启nginx应该解决问题。如果不想用root用户,就换个目录,但不要放在root宿主的目录下,别忘记给个755权限。