1.打开伪静态
2.在创建站点时报:404 Not Found问题:
具体配置内容:
server{listen 80; server_name www.yxw.com;index index.php;root /work/yxw;#error_page 404 /404.html;location /{index index.php;#ThinkPHP REWRITE支持if (!-e $request_filename) {rewrite ^/(.*)$ /index.php?s=$1 last;}#301 跳转设置if ($host = 'www.yxw.com') {rewrite ^/(.*) http://www.yxw.cn/$1 permanent;}} location ~ [^/]\.php(/|$){# comment try_files $uri =404; to enable pathinfotry_files $uri =404;fastcgi_pass unix:/tmp/php-cgi-70.sock;#这里的版本要和安装php的版本一样的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 /work/yxw/yxw.log access;}
3.报错:nginx 502 Bad Gateway
fastcgi_pass unix:/tmp/php-cgi-70.sock;#这里的版本要和安装php的版本一样的