买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。8 f- j- ?$ T7 x9 A6 U
昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:
, Y1 k# G; I! J : n4 ^3 Q8 S" Q$ K; E1 G$ s* c
3 }2 m& R7 c4 `3 D2 j6 ]3 [! ? Hi, P& @; Y) }, q+ E1 K- L
- B# P) X3 n5 q) I+ K2 _/ t8 ^
Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly: % l( X k# y9 ]" E$ P0 ~2 {
; i: O& I& \% n6 M' R! K
Just replace root /home/forge/default/public; with path to the script on your server.
0 a4 E& N4 Q8 g0 H + s' u, s" ~; f2 q- ~8 M4 m- V2 R
server {
8 V! U* W8 z" [4 W8 `; s listen 80 default_server;
- P! J6 A" v" q* Q9 n/ j! y server_name default;
; y y5 r- N% ~) i1 I" ] j2 S root /home/forge/default/public;
: l$ [* }$ f, t1 B# n; ] 7 b9 X) Z5 C N2 I; t
index index.html index.htm index.php;
2 X4 K$ r& j' Q' c8 Q2 {
1 c( x" x. U; x8 }6 z$ T- t4 f! z charset utf-8;, r/ A, T: U8 _5 c+ T
: ] Y% R" |; h: G location / {
8 Y( l3 M! Q0 }! f& F, N try_files $uri $uri/ /index.php?$query_string;: w+ e' T7 s4 e Y1 w" G+ O
}( G+ P; o2 o- J/ g O7 ]6 M5 o. ]
1 {+ F/ e: T2 p1 p0 t7 d r T8 F location = /favicon.ico { access_log off; log_not_found off; }
7 r O- i' j r& [7 W8 C location = /robots.txt { access_log off; log_not_found off; }
1 g+ N& l" k( x _, X& {2 y1 ^5 z 0 H, T$ t7 c3 f n* V2 G& {& E
access_log off;
# W* D5 N: o. i3 | error_log /var/log/nginx/default-error.log error;
' l& G0 |- t' P1 X; C$ _
: B' i/ h+ { d% U+ M error_page 404 /index.php;
: f* Y% f, J) _; E: r, p # ?. M$ ?8 w1 {: s3 r% @9 I! G. T& S+ J
location ~ \.php$ {2 f7 ^! G4 r: @0 P2 ]: y. Z
fastcgi_split_path_info ^(.+\.php)(/.+)$;- Y+ O* u/ H, _$ a: M. x
fastcgi_pass unix:/var/run/php5-fpm.sock;
% ]+ Q6 I. l( y4 I& g" N1 m fastcgi_index index.php;) l. i' w: |6 p! s
include fastcgi_params;. U$ g$ \: a3 ?8 z! b- ~1 ~7 ]
}0 N) O, |3 z% I! I W1 ~
$ g: X; ~( }4 G x" G location ~ /\.ht {
: @+ I/ @/ |; M7 Y" U2 B deny all;5 r/ s5 T& S( c, E
}
0 \% p0 z% n5 V. c4 b! J$ h3 R4 w } 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。+ D' L* v" E2 W6 p
8 }5 o. v& \$ |1 t/ j3 A5 A
在线等,谢谢!!!1 a( m/ W# S L
相关帖子