nginx的配置
你参考一下,改成自己的目录和域名
server
{
listen 80;
#listen [::]:80;
server_name
www.gfw.im gfw.im;
rewrite ^/(.*)
https://www.gfw.im/$1 permanent;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/
www.gfw.im;
include wordpress.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/www.gfw.im.log access;
}
server
{
listen 443 ssl spdy;
ssl on;
ssl_certificate /home/wwwroot/ssl/ssl.crt;
ssl_certificate_key /home/wwwroot/ssl/ssl.key.out;
ssl_session_timeout 5m;
#listen [::]:80;
server_name
www.gfw.im gfw.im;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/
www.gfw.im;
include wordpress.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/www.gfw.im.log access;
}