买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。
8 ?: n& y# r! A. n 昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:
1 y& S [7 {, a+ a8 m% @ 0 f) G6 L6 j7 f* E
: Z s8 Y; m5 D; o d8 T
Hi,
( I& U D8 r& ]! c 6 i0 v' R9 K7 ?% p
Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly:
8 i3 g& d! X, s2 b 6 s2 n6 W' S- |- r. H
Just replace root /home/forge/default/public; with path to the script on your server.4 i1 D/ `$ q. F$ P4 T9 I" c+ `5 W2 X6 _
" w \: A+ y$ O( S* P server {
/ ]1 M% e* j6 G- U& t) P listen 80 default_server;: Y$ F* z& A! a+ V
server_name default;/ I6 [/ }/ Q& R$ s
root /home/forge/default/public;8 e" F8 f t' T/ k% I# u) i
! z& Y. M) M& h. s( c. c; `
index index.html index.htm index.php;' P. F7 M. ~8 T! N
$ ~" I# f; c H charset utf-8;+ i4 }: r+ G F6 Q% ]4 \& v2 e( D# D
: ~, S# }& L" z6 |4 O location / {
+ f, E# e2 q* p! s, K+ u/ G try_files $uri $uri/ /index.php?$query_string;# b% g1 N( n$ Q( t. V# F* g1 w+ Z
}3 H& g+ u* w7 U+ s* j( i
+ a& b) Z3 s" [1 C, |* J0 U9 h; X location = /favicon.ico { access_log off; log_not_found off; }( m4 G# ]& R- a, e( o
location = /robots.txt { access_log off; log_not_found off; }
) ~( U# Z/ O# K
7 H9 `. L; ?& U! ]) i8 M access_log off;
5 D6 _' x( @- ^: A) Z7 j% U ^* Y error_log /var/log/nginx/default-error.log error;# ~2 q' y2 N- U; O0 K
' S7 v: [2 b" U* t$ D error_page 404 /index.php;% Q8 a% S6 L! ^- W9 r
" G. j' l, V& U1 E location ~ \.php$ {+ u5 w8 v2 K. y+ H O3 I1 [7 e
fastcgi_split_path_info ^(.+\.php)(/.+)$;
/ c( w0 t: p: h fastcgi_pass unix:/var/run/php5-fpm.sock;
9 @# J' y# i4 `1 e* j fastcgi_index index.php;1 q* q$ X* o7 O
include fastcgi_params;
2 e+ A# p6 S, E; j" `0 n }
; f v _- H6 X6 F% b
`/ X" M# |4 O" w7 G4 O3 I# f6 E& B location ~ /\.ht {
: E. _7 _2 u+ s; Q) r! d+ c* o& Y) j deny all;- M9 a" D' e1 M& N
}
2 \* G2 G; k9 E- [: F! ^: @+ x } 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。
r Z: M1 t8 v
3 f6 b# D) ~' R2 u 在线等,谢谢!!!
$ o4 Y' f: [' |! Q7 q) h
相关帖子