VPS侦探论坛

 找回密码
 注册
查看: 17954|回复: 19

WordPress伪静态请教

[复制链接]
发表于 2011-10-28 10:54:01 | 显示全部楼层 |阅读模式

VPS按照好后 我是直接在 /usr/local/nginx/conf/nginx.conf修改的
如下内容:

server
        {
                listen       80;
                server_name fangtr.com www.fangtr.com;
                index index.html index.htm index.php;
                root  /home/wwwroot/fangtr/;
                include /usr/local/nginx/conf/wordpress.conf;


重启过后

可以打开Blog的首页 但是文章打开显示
抱歉,无法打开该页面
求教 谢谢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-10-28 10:56:03 | 显示全部楼层


你执行 /root/vhost.sh 试试~~
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-10-28 12:13:17 | 显示全部楼层

回复 2# 的帖子


之前也试过了 差不多的问题
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-10-28 22:25:49 | 显示全部楼层



这一个就要看情况了呀,你是使用的什么服务器呀?还有啊。。这一个WORLDPRESS的INLUCDE是加在你的虚拟主机里面的吧?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-10-28 22:40:22 | 显示全部楼层

server {
listen 80;
server_name ccvita.com www.ccvita.com;
location / {
        index index.html index.htm index.php;
        root /www/wwwroot/ccvita.com;
        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;
        }

}
location ~ \.php$ {
        include fastcgi_params;
        fastcgi_index index.php;
        fastcgi_pass 127.0.0.1:8787;
        fastcgi_param SCRIPT_FILENAME /www/wwwroot/ccvita.com$fastcgi_script_name;
        }
location /ccvita-status {
        stub_status on;
        access_log off;
        }
}

军哥运维代购:http://shop63846532.taobao.com/

发表于 2011-10-28 22:40:46 | 显示全部楼层

看着这一个样本做就可以弄得出来了。
 楼主| 发表于 2011-10-31 10:21:46 | 显示全部楼层

原帖由 yuweitaocn 于 2011-10-28 22:40 发表
看着这一个样本做就可以弄得出来了。

好的 谢谢 我去试试看
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-12-13 13:56:01 | 显示全部楼层

回复 5# 的帖子


我使用的linode的vps,操作系统是Debian,安装的是 LNMP0.7
试过前面的 还是无法做伪静态
按照你的,直接打开是502
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-12-13 13:57:25 | 显示全部楼层

回复 8# 的帖子


fastcgi的地址和端口改成军哥的。。应该是127.0.0.1"9000
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-12-13 15:45:47 | 显示全部楼层

回复 9# 的帖子




出现:502 Bad Gateway
错误了
 楼主| 发表于 2011-12-15 12:39:08 | 显示全部楼层

求助啊 怎么才能做wordpress的伪静态?
发表于 2011-12-15 13:27:00 | 显示全部楼层

不会自己改配置就直接用/root/vhost.sh 添加
lnmp不是用端口的是用socket的
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-12-15 13:51:19 | 显示全部楼层
原帖由 licess 于 2011-12-15 13:27 发表
不会自己改配置就直接用/root/vhost.sh 添加
lnmp不是用端口的是用socket的

我直接用vhost.sh增加的也没有效果
include wordpress.conf;
直接没有效果
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-12-15 14:31:37 | 显示全部楼层
贴配置看看

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-12-15 17:34:31 | 显示全部楼层

回复 14# 的帖子

user  www www;

worker_processes 1;

error_log  /home/wwwlogs/nginx_error.log  crit;

pid        /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
        {
                use epoll;
                worker_connections 51200;
        }

http
        {
                include       mime.types;
                default_type  application/octet-stream;

                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 50m;

                sendfile on;
                tcp_nopush     on;

                keepalive_timeout 60;

                tcp_nodelay on;

                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 256k;

                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;

                #limit_zone  crawler  $binary_remote_addr  10m;

server
        {
                listen       80;
                server_name  xxxxx.com www.xxxxx.com;
                index index.html index.htm index.php;
                root  /home/wwwroot/;
                include wordpress.conf;

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log  /home/wwwlogs/access.log  access;
        }
include vhost/*.conf;
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-21 22:30 , Processed in 0.030797 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表