大家好,在VPS下安装TYPECHO 遇到了问题请大家帮一下忙,谢谢。
只能打开首页,其它连接都是404.not found ,在网站的文档区看到要设置 location段,但改了也没用,还是一样打不开也无法登录后台,能否帮一下忙感激不尽。
这是我的nginx.conf文件 未做修改,请问要如何修改呢?
谢谢
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php(\/.*)*$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php(\/.*)*$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
VPS下载安装typecho 的问题
Re: VPS下载安装typecho 的问题
可以参考下lnmp一键包里面的配置文件nginx.conf
__________________
新版阿里百秀Alibaixiu主题 v11.1 For Typecho http://xiu.160.me/
__________________
新版阿里百秀Alibaixiu主题 v11.1 For Typecho http://xiu.160.me/
Re: VPS下载安装typecho 的问题
谢谢回复。
server
{
listen 80 default;
#listen [::]:80 default ipv6only=on;
server_name www.163.com;
index index.php index.html index.htm;
root /home/wwwroot/default;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
access_log logs/163.com.log combined;
}
#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;
}
现在是这个样子,但还是只能打开主页,其他都是404 not found
能否再帮忙看看?谢谢
server
{
listen 80 default;
#listen [::]:80 default ipv6only=on;
server_name www.163.com;
index index.php index.html index.htm;
root /home/wwwroot/default;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
access_log logs/163.com.log combined;
}
#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;
}
现在是这个样子,但还是只能打开主页,其他都是404 not found
能否再帮忙看看?谢谢
Re: VPS下载安装typecho 的问题
已搞定,是ngnix,conf 配置问题 谢谢大家