错误提示
Reload service nginx... nginx: [emerg] "http" directive is not allowed here in
使用的是
lnmp.org 一键安装包!
去掉 http 那块 反代是可以的。。。现在想设置缓存空间大小与指定目录就错误了。
http
{
proxy_temp_path /tmp/proxy_temp_dir;
proxy_cache_path /tmp/proxy_cache_dir levels=1:2 keys_zone=nginx_cache8:10m inactive=3d max_size=30g loader_files=100 loader_threshold=200ms loader_sleep=50ms;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
}
server
{
listen 80;
#listen [::]:80;
server_name
jp.xz.adbadb.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/
jp.xz.adbadb.com;
include none.conf;
#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;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
location / {
proxy_pass
http://xz.adbadb.com;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://tanronggui.xyz/t/203426
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.