大网数据广告活动
网站运营与故障问答

Move a blog on a different server from a subdomain to a folder using Nginx

· 52CE 我爱测

I have a node js application that runs on a VPS, and recently we added a blog to the site, we choose WordPress for the blog CMS, for avoiding configuring VPS for PHP and WP we moved blog to another host with cpanel and different …

问题原文

原帖链接 · Sinandro · CC BY-SA 4.0

I have a node js application that runs on a VPS, and recently we added a blog to the site, we choose WordPress for the blog CMS, for avoiding configuring VPS for PHP and WP we moved blog to another host with cpanel and different ip on a blog.domain.com subdomain. Now we decide for some reason (SEO and etc) to move from subdomain to subfolder of the main domain.

So my solution so far is that main domain is point to VPS ip, and nginx handle all requests, and if the requested url followed the /blog/* pattern, the nginx redirect request to the second host ip with cpanel where blog is hosted.


Now I have these questions:

  1. Is this way a proper way to resolve this challenge? Is there better way?

  2. Is redirecting to another IP BAD for SEO? Or it's OK?

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

There is no SEO benefit to hosting your blog on a folder compared to as on a subdomain. See Do subdomains help/hurt SEO?

You don't want to do any redirecting. Redirects change the URL in the browser address bar. Redirecting to change the URL to a different IP address would be far worse for SEO than hosting on a subdomain.

If you insist on having it in the folder location, you will need to use a "reverse proxy". A reverse proxy copies the content from another location dynamically on the fly. Nginx has functionality for it built in. See: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

A reverse proxy can also be bad for SEO because it introduces performance delays. If you are using a reverse proxy, make sure the two machines are near each other, like on the same subnet in the same data center.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2018-12-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。