首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何通过使用proxy_pass配置nginx.conf来使用Nginx作为博客的反向代理

如何通过使用proxy_pass配置nginx.conf来使用Nginx作为博客的反向代理
EN

Stack Overflow用户
提问于 2012-11-20 10:04:32
回答 2查看 1.1K关注 0票数 4

我正在努力让我的网站mysite.com/blog显示没有tumblr URL的tumblr博客。

我使用的是NGINX,并由nginx.conf更新了以下内容:

代码语言:javascript
复制
location /blog {
  proxy_set_header  X-Real-IP  $remote_addr;
  proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  proxy_redirect off;

  gzip on;
  gzip_min_length  1100;
  gzip_buffers     4 8k;
  gzip_proxied any;
  gzip_types  text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

  if (!-f $request_filename) {
    rewrite ^/blog$     /;
    rewrite ^/blog/(.*)$ /$1;
    proxy_pass http://denise-puchol.tumblr.com/;
    break;
  }
}

这是失败,但没有错误消息。你知道我哪里做错了吗?谢谢

EN

回答 2

Stack Overflow用户

发布于 2013-05-15 03:12:02

This nginx gist可以帮助你为Tumblr博客建立一个反向代理。用于搜索引擎优化的Definitely worthwhile to subfolder rather than subdomain your blog

票数 2
EN

Stack Overflow用户

发布于 2012-11-20 10:13:54

如果只使用一个自定义域名,比如:http://www.tumblr.com/docs/en/custom_domains

您可能需要将您的url方案更改为blog.mysite.com,但它有一个巨大的优势,即通过您的服务器将流量直接发送到tumblr的服务器。如果你的博客收到了大量的流量,你的服务器可能会不堪重负。此外,攻击者可能会滥用您的代理对tumblr发起攻击,然后看起来就像是来自您的服务器。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13465566

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档