Nginx启动不起来 请检查Nginx安装目录下面的log日志
nginx不重启使配置生效 输入命令:nginx -s reload
server {
listen 80;
server_name www.网址.com;
rewrite ^(.*)$ https://$host$1 permanent;
location / {
}
}
server {
listen 80;
server_name 网址.com;
rewrite ^(.*)$ https://www.网址.com permanent;
location / {
}
}
server {
listen 443;
server_name www.网址.com; #填写绑定证书的域名
ssl on;
ssl_certificate /usr/local/nginx/conf/ssl/1_www_bundle.crt;
ssl_certificate_key /usr/local/nginx/conf/ssl/2_www.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 on;
index index.html index.htm index.php;
root /www/path/;
location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
if (!-e $request_filename) {
rewrite ^(.*)/(.+)list-([0-9]+)-([0-9]+)\.html$ $1/index.php?a=$2list&fid=$3&p=$4 last;
rewrite ^(.*)/(.+)list-([0-9]+)\.html$ $1/index.php?a=$2list&fid=$3 last;
rewrite ^(.*)/(.+)-([0-9]+)\.html$ $1/index.php?a=$2&id=$3 last;
rewrite ^(.*)/(.+)\.html$ $1/?a=$2 last;
rewrite ^(.*)$ /index.php?s=$1 last;
}
}
server {
listen 80;
server_name www.网址.com
index index.html index.htm index.php;
root /www/path;
location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ttf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}