How to fix wordpress on Nginx 404 not found page

Posted Leave a commentPosted in Skill

Please add following text into nginx configuration file. location / { # This is cool because no php is touched for static content. # include the “?$args” part so non-default permalinks doesn’t break when using query string try_files $uri $uri/ /index.php?$is_args$args =404; } if (!-e $request_filename) { rewrite ^.*$ /index.php last; }  

How to fix 404 not found in Nginx of WordPress website

Posted Leave a commentPosted in Skill

how to fix ? it’s a really simple issues, just use rewrite function could be fix it. the code will be like this. location / { index index.html index.php; if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } } rewrite /wp-admin$ $scheme://$host$uri/ […]

快速搭建 Nginx + https + wordpress + Let’s Encrypt永久免费SSL证书

Posted Leave a commentPosted in Skill

首先准备一台Google cloud server, CentOS 6.1 安装必要软件 sudo yum -y install nginx php php-mysql mysql mysql-server git php-fpm php-xml php-mbstring 启动相关软件 sudo chkconfig mysqld on sudo service mysqld start sudo chkconfig nginx on sudo service nginx start sudo service php-fpm start sudo chkconfig php-fpm on 此时在浏览器输入 该服务器IP确保已经可以正常访问 设置mysql数据库 sudo mysql_secure_installation 1. Enter current password for root […]

nginx强制使用https访问(http跳转到https)

Posted Leave a commentPosted in Skill

1. nginx的rewrite方法 思路 这应该是大家最容易想到的方法,将所有的http请求通过rewrite重写到https上即可 配置 server { listen 192.168.1.111:80; server_name test.com; rewrite ^(.*)$ https://$host$1 permanent; } 搭建此虚拟主机完成后,就可以将http://test.com的请求全部重写到https://test.com上了 2. nginx的497状态码 error code 497 497 – normal request was sent to HTTPS 解释:当此虚拟站点只允许https访问时,当用http访问时nginx会报出497错误码 思路 利用error_page命令将497状态码的链接重定向到https://test.com这个域名上 配置 server { listen 192.168.1.11:443; #ssl端口 listen 192.168.1.11:80; #用户习惯用http访问,加上80,后面通过497状态码让它自动跳到443端口 server_name test.com; #为一个server{……}开启ssl支持 ssl on; #指定PEM格式的证书文件 ssl_certificate /etc/nginx/test.pem; #指定PEM格式的私钥文件 ssl_certificate_key /etc/nginx/test.key; #让http请求重定向到https请求 error_page […]

申请Let’s Encrypt永久免费SSL证书

Posted Leave a commentPosted in Skill

申请Let’s Encrypt永久免费SSL证书 Let’s Encrypt简介 Let’s Encrypt作为一个公共且免费SSL的项目逐渐被广大用户传播和使用,是由Mozilla、Cisco、Akamai、IdenTrust、EFF等组织人员发起,主要的目的也是为了推进网站从HTTP向HTTPS过度的进程,目前已经有越来越多的商家加入和赞助支持。 Let’s Encrypt免费SSL证书的出现,也会对传统提供付费SSL证书服务的商家有不小的打击。到目前为止,Let’s Encrypt获得IdenTrust交叉签名,这就是说可以应用且支持包括FireFox、Chrome在内的主流浏览器的兼容和支持,虽然目前是公测阶段,但是也有不少的用户在自有网站项目中正式使用起来。 步骤如下: 第一、安装Let’s Encrypt前的准备工作 #检查系统是否安装git,如果已经自带有git会出现git版本号,没有则需要我们自己安装 git –version #git 安装 yum install git #检查Python的版本是否在2.7以上 python -version //2.6版本 #安装python所需的包 yum groupinstall -y “Development tools” #安装python所需的包 yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel #获取到Python # wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz # tar xf Python-2.7.12.tgz # cd Python-2.7.12 # ./configure –prefix=/usr/local/python27 # make # make […]

CentOS6系统安装Python2.7

Posted Leave a commentPosted in Skill

简介 CentOS系统安装Python2.7有两种方式: 源码安装 YUM安装 网上大部分教程都是通过源码安装,首先安装比较麻烦,源码安装后还不包含pip,setuptools等工具,需要单独安装。安装过程还会碰到各种疑难杂症。 YUM安装,CentOS6版本默认没有python27的rpm包,需要通过其他第三方repo获取安装包。 源码安装 # wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz # tar xf Python-2.7.12.tgz # cd Python-2.7.12 # ./configure –prefix=/usr/local/python27 # make # make install YUM安装 需要使用到RHEL/CentOS提供的SCL源(软件集) 配置 SCL 源 # yum install centos-release-SCL # yum install scl-utils-build # yum –disablerepo=”*” –enablerepo=”centos-sclo-rh” list # yum install python27 -y 配置Python27以来的系统模块 # find / -name libpython2.7.so.1.0 /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0 […]

How to create a bootable installer for macOS

Posted Leave a commentPosted in Skill

Download macOS from the App Store Download macOS from the App Store. To download, use a Mac that is compatible with the version of macOS you’re downloading. If you’re downloading macOS High Sierra, use a Mac with High Sierra, Sierra 10.12.5 or later, or El Capitan 10.11.6. Enterprise administrators: Please download from Apple, not a locally hosted software-update […]