买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。+ ?: P7 O7 H! s. M2 s- \. ~! {
昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:
& q3 z# y% i1 X1 e+ g# t e 2 c% L2 _9 |- ?9 w
! b% A Z4 _- \! J9 h" [+ |$ f
Hi,
" s9 J! N9 _: U( ^; Z$ M% u) m
& f }$ n& K0 X( z9 | Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly:
- T' B t+ I: v8 |% L+ S
/ Z- v) b9 O9 P% _1 }+ M, k2 J Just replace root /home/forge/default/public; with path to the script on your server.2 Z5 L" p( R( K* Y$ T
0 A) k" R% F J* D
server {; {2 x5 w ~& C# M/ q
listen 80 default_server;
$ D4 h1 V4 q2 u server_name default; d+ ^- t4 e6 `# h2 |
root /home/forge/default/public;
6 u: [5 m0 i8 i; D; v 5 K8 ^$ v7 ] P, g8 E7 @2 A
index index.html index.htm index.php;1 \/ J/ Y6 \$ K, I: l2 c0 ?
( D9 u$ `3 S( W2 c
charset utf-8;
' p5 }) Z1 Y3 O5 w* }# g ; `, B7 ~; _; F* ?6 e
location / {/ `/ S# b( k6 I9 p
try_files $uri $uri/ /index.php?$query_string;* y6 a- M: [# `( a: Y7 J
}
* U, }: u' O8 Z4 v: D
0 \8 E& C& f( l! }2 n+ y location = /favicon.ico { access_log off; log_not_found off; } x: Y% |! q/ D q8 l
location = /robots.txt { access_log off; log_not_found off; }) j; |/ ~1 J7 h: Q4 S
& X m/ s/ U, U
access_log off;
$ M6 T* O$ l2 N error_log /var/log/nginx/default-error.log error;
# `; s3 J6 |+ T6 k" C ; @2 S3 D9 z. f. i& \2 g
error_page 404 /index.php;
% l8 |' D* Q, Y* y7 O/ r! U
0 @5 |9 o C, }. d location ~ \.php$ {+ Z6 v" }7 u4 W( A0 u; l6 {( e
fastcgi_split_path_info ^(.+\.php)(/.+)$;
6 C2 ~& U$ M, \. y- l4 U/ }" @ fastcgi_pass unix:/var/run/php5-fpm.sock;3 t9 T, E" `$ D" r' k1 g
fastcgi_index index.php;
- d8 d: y5 C, N5 ` include fastcgi_params;' j" {, H- @+ y! `2 P: m3 y
}
" N: f5 ?# @1 u; O* b) M
5 q/ d. H: g$ _4 h' @& i# n& {/ } location ~ /\.ht {
+ T) w- n& c8 _, f4 { deny all;6 w( p( A, Q( b- L
} {, V* E( O8 V* ?- u; Q
} 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。4 A. Q" c2 T6 f8 W- L2 I
$ z' r9 r' i" f t3 h
在线等,谢谢!!!
$ [ L. {& W& P& a
相关帖子