V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  sxchen2012  ›  全部回复第 1 页 / 共 1 页
回复总数  3
感谢各位,按照 13 楼的建议,撸了个配置,已经 ok 了,多谢 @zjsxwc
刚接触 Nginx,想都理解下
@norain 只是感觉很奇怪,想瞅瞅
不知道标题描述清楚没有
wordpress 页面现在丑的雅痞,CSS 和图片感觉加载不起来,就在浏览器里面去专门访问图片,拿到个一个问号。
后台用 curl 去 GET,跟浏览器情况一致。
是图片太大,buffer 太小,感觉跟 NGINX 配置有关系,萌新求指导?

[root@host images]# pwd
<pre><code>/opt/nginx/html/blog/wp-content/themes/twentyseventeen/assets/images
[root@host images]# l
<pre><code>total 536
-rwxrwxrwx 1 nginx nginx 117713 Nov 23 2016 coffee.jpg
-rwxrwxrwx 1 nginx nginx 93540 Nov 23 2016 espresso.jpg
-rwxrwxrwx 1 nginx nginx 114854 Nov 17 2016 header.jpg
-rwxrwxrwx 1 nginx nginx 171858 Nov 23 2016 sandwich.jpg
-rwxrwxrwx 1 nginx nginx 42656 Sep 25 09:49 svg-icons.svg</code></pre>

[root@host ~]# curl -i -X GET http://104.225.150.251/wp-content/themes/twentyseventeen/assets/images/header.jpg
<pre><code>HTTP/1.1 200 OK
Server: nginx/1.12.2
Date: Sun, 28 Jan 2018 17:24:52 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.3.27

?[root@host ~]# l</code></pre>

NGINX 配置
<pre><code>worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
error_page 500 502 503 504 /50x.html;
fastcgi_buffers 512 128k;
location = /50x.html {
root html;
}
location / {
root html/blog;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
}</code></pre>
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   961 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 20:51 · PVG 04:51 · LAX 12:51 · JFK 15:51
Developed with CodeLauncher
♥ Do have faith in what you're doing.