[root@izkbs00av8xzccz conf.d]# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.[root@izkbs00av8xzccz conf.d]# vim default.conf
###################### Default ################################
server { listen 80 default_server; server_name www.mydomain.com mydomain.com; index index.html index.htm index.php; #此行我去掉了index.php 和前面的index就出现报错 root /data/wwwroot/default; error_log /var/log/nginx/default-error.log crit;location ~ .*\.php$
{ fastcgi_pass unix:/dev/shm/php-fpm-default.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; try_files $uri = 404; }location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma|mp4|ico)$
{ expires 30d; access_log off; }location ~ .*\.(js|css)$
{ expires 7d; access_log off; }location ~* \.(ftpquota|htaccess|htpasswd|asp|aspx|jsp|asa|mdb)?$ {
deny all; }################################ SSL #########################################
#listen 443 ssl; #ssl on; #ssl_certificate /data/cert/xxx.crt; #ssl_certificate_key /data/cert/xxx.key #ssl_session_timeout 5m; #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; #ssl_prefer_server_ciphers ## 301 重定向 http => https #if ( != "https") { #return 301 https://; #} ############################### extra ######################################## include /etc/nginx/conf.d/extra/*.conf; }[root@izkbs00av8xzccz conf.d]# systemctl restart nginx #正确