没有不值得去解决的问题,也没有不值得去学习的技术!

A Tour of Go Multilingual Translation Project: Migrating From go-tour to go-dev With EdgeOne, Nginx, and HTTPS Production Domains

Figure 1: The new production domain go-dev.shuijingwanwq.com is accessible normally, and the Go example runs successfully remotely

作者:

在

Shortly after the A Tour of Go Simplified Chinese site officially launched, I quickly noticed an issue I had not prioritized before: there was a semantic overlap between the production domain and the Tour’s own path.

The original production domain was:

https://go-tour.shuijingwanwq.com

However, A Tour of Go itself still uses the official /tour/ path, meaning the actual course page becomes:

https://go-tour.shuijingwanwq.com/tour/welcome/1

In other words, the go-tour in the domain and the /tour/ in the path are redundant.

In fact, I had specifically analyzed this issue the night before the official launch.

My initial thought was not to change the domain, but rather:

Could we just remove /tour/ from the URL?

If it could be changed to:

https://go-tour.shuijingwanwq.com/welcome/1

On the surface, the URL would be much cleaner.

But upon further analysis, I found that /tour/ is not a decorative prefix that can simply be deleted. It has formed deep ties with the current Tour’s routing, page paths, static assets, template structure, browser validation, and existing deployment methods.

Removing /tour/ to eliminate this redundancy would require reviewing and modifying an entire set of path logic that had already been validated.

At the time, the project had just completed:

  • All 103 course pages ready;
  • Public UI localization;
  • Final browser validation;
  • Production deployment package;
  • EdgeOne and Nginx deployment;
  • Remote Go Playground execution pipeline.

To remove a single /tour/ from the URL, expanding the scope of code changes and validation again was not cost-effective.

Therefore, I ultimately abandoned the plan to “delete /tour/” that night.

The next day, I approached the problem from a different angle:

Since /tour/ isn’t worth modifying for now, could we change the domain itself from go-tour to a broader name?

This made go-dev a natural candidate.

If changed to:

https://go-dev.shuijingwanwq.com/tour

The original go-tour.../tour/... redundancy disappears naturally, without needing to modify the already stable Tour routing and page structure.

More importantly, this also solves another long-term issue.

If A Tour of Go eventually gains traction, I might continue translating other valuable official content within go.dev.

In that case, go-tour would feel too narrow as a site-level domain, whereas:

go-dev.shuijingwanwq.com

is better suited as a long-term entry point that could host multiple Go development documentation directories in the future.

Ultimately, I decided to migrate the official production domain from:

go-tour.shuijingwanwq.com

to:

go-dev.shuijingwanwq.com

The new official entry point for A Tour of Go became:

https://go-dev.shuijingwanwq.com/tour

This adjustment was therefore not just about making the URL look cleaner. It was about resolving the domain redundancy with minimal changes, without disrupting the existing /tour/ path structure, while leaving room for future expansion.

This article documents the complete production domain migration process from go-tour to go-dev, covering Cloudflare DNS, Tencent Cloud EdgeOne, HTTPS, 301 redirects, OneinStack, Nginx, Let’s Encrypt, as well as the final origin server cleanup and validation.


1. Migration Principle: Change Only the Public Entry Point, Do Not Refactor Internal Services

This migration first established a principle:

The public domain needs to change, but the internal project and service names that are already running stably do not need to be renamed along with it.

Before migration:

https://go-tour.shuijingwanwq.com/tour

After migration:

https://go-dev.shuijingwanwq.com/tour

However, the following internal names all remain unchanged:

  • GitHub repository: go-tour-i18n
  • Go module path: github.com/shuijingwan/go-tour-i18n
  • systemd service: go-tour.service
  • Service listen address: 127.0.0.1:3999
  • Production deployment directory: /data/go-tour/

In other words, what actually changed this time was:

公网域名 → CDN → Nginx 虚拟主机

rather than renaming the entire project from go-tour to go-dev.

This significantly narrows the scope of the migration and avoids adding risk to the already stable production services just for the sake of name consistency.

Figure 1: The new production domain go-dev.shuijingwanwq.com is accessible normally, and the Go example runs successfully remotely
Figure 1: The new production domain go-dev.shuijingwanwq.com is accessible normally, and the Go example runs successfully remotely

2. First, Get go-dev Running Independently on EdgeOne

I did not shut down the old domain right from the start; instead, I let the old and new domains coexist first.

First, I added the following in Tencent Cloud EdgeOne:

go-dev.shuijingwanwq.com

The origin server continues to use the existing server:

121.40.248.29

Origin protocol:

HTTPS

Port:

443

To verify the new domain as quickly as possible, I initially set the EdgeOne origin Host to:

go-tour.shuijingwanwq.com

This means the actual link at this point was:

go-dev → EdgeOne → go-tour 源站虚拟主机 → Go Tour

This allowed me to directly reuse the Nginx HTTPS configuration that had already been validated the day before. I could confirm whether the new public domain was working properly without modifying the server first.

In Cloudflare DNS, I added a new CNAME:

go-dev.shuijingwanwq.com

Pointing to:

go-dev.shuijingwanwq.com.eo.dnse2.com

The proxy status remained “DNS only,” letting EdgeOne officially handle the CDN and HTTPS services.

Next, I requested a free HTTPS certificate for the new domain in EdgeOne and used automatic validation.

Once the certificate was deployed, the new domain was quickly accessible:

https://go-dev.shuijingwanwq.com/tour/welcome/1

The Chinese course text, the right-side editor, and the page’s static assets all displayed normally.

I clicked “Run” once more to confirm that the production environment could still execute the example code via the remote Go Playground, which ultimately returned:

Plaintext
Hello, 世界
程序已退出。

There was an occasional timeout during this process, but running it again succeeded immediately.

Therefore, this issue was not treated as a blocker for the domain migration. If remote execution timeouts become a frequent issue later, I can troubleshoot it separately.


3. Do Not Delete the Old Domain Directly; Instead, Permanently 301 Redirect to go-dev

Although the original go-tour.shuijingwanwq.com had just officially launched, I still chose not to simply deprecate it.

The reason is simple.

Even if it was only live for a day, there might already be:

  • Browser history records;
  • Old links in blog posts;
  • URLs discovered by search engines but not yet officially indexed;
  • Addresses I had saved or shared myself.

Therefore, a safer approach was still:

Permanently 301 redirect the old domain to the new domain, keeping the original path intact.

For example:

https://go-tour.shuijingwanwq.com/tour/welcome/1

Permanently redirects to:

https://go-dev.shuijingwanwq.com/tour/welcome/1

Instead of having all old pages uniformly redirect to the new site’s homepage.

I created a rule directly in the EdgeOne Rule Engine.

Match condition:

HOST = go-tour.shuijingwanwq.com

Action:

  • Access URL redirect;
  • Target protocol: HTTPS;
  • Target Hostname: go-dev.shuijingwanwq.com;
  • Target path: Follow request;
  • Query parameters: Preserve;
  • Status code: 301.
Figure 2: At the EdgeOne edge, the old go-tour domain is permanently 301 redirected to go-dev, while preserving the original path and query parameters
Figure 2: At the EdgeOne edge, the old go-tour domain is permanently 301 redirected to go-dev, while preserving the original path and query parameters

Immediately after publishing, I performed a live validation:

Plaintext
HTTP/2 301
location: https://go-dev.shuijingwanwq.com/tour/welcome/1
server: TencentEdgeOne

This shows that the redirect happens directly at the EdgeOne edge nodes, without needing the request to reach the origin Nginx server.

This also paved the way for completely deleting the old go-tour virtual host on the server later.


4. Recreate an Independent Nginx Virtual Host for go-dev

Although the new domain was already accessible, it was still temporarily routing through:

Host: go-tour.shuijingwanwq.com

back to the old Nginx virtual host.

To truly complete the migration, the server should ultimately only retain:

go-dev.shuijingwanwq.com

Therefore, the next step was to create a new, independent Nginx virtual host on the origin server.

My server uses OneinStack, so I continued to follow this principle:

For any operation where OneinStack already provides a script or built-in process, prioritize using OneinStack rather than bypassing it to call underlying tools directly.

This time, I used:

Bash
cd /root/oneinstack

./vhost.sh --proxy --dnsapi

Where:

  • --proxy: Create a reverse proxy virtual host;
  • --dnsapi: Issue an HTTPS certificate using the DNS API method.

The new domain entered was:

go-dev.shuijingwanwq.com

HTTPS uses Let’s Encrypt.

The certificate key type continues to use:

ec-256

DNS provider uses:

cf

Which is Cloudflare DNS validation.

The reverse proxy target remains:

http://127.0.0.1:3999

This way, the new virtual host ultimately still connects to the existing:

go-tour.service

The Go application was not redeployed.


5. During the Operation, I Found the Old OneinStack Directory Still Existed

During this operation, I also discovered an issue that could easily cause confusion in the future.

Both of these existed simultaneously on the server:

/root/oneinstack

And the new version used when upgrading to PHP 8.5:

/root/oneinstack-latest-20260804

The original /root/oneinstack was actually an old version left over from around 2023.

In other words, if I habitually continued to use:

Bash
cd /root/oneinstack

It would easily invoke the old script again.

Since the new version of OneinStack had already been validated through actual maintenance like the PHP 8.5 upgrade, I decided to standardize the directory while doing this.

After confirming that no cron jobs, systemd services, or shell configurations had hardcoded references to the old path, I temporarily renamed the old version:

/root/oneinstack-old-20260812

Then promoted:

/root/oneinstack-latest-20260804

to the standard directory:

/root/oneinstack

After completing all production validation, the old 2023 version was finally deleted.

This way, all future OneinStack maintenance will uniformly start from:

/root/oneinstack

avoiding selecting the wrong version again due to the coexistence of old and new scripts.


6. OneinStack’s Auto-Generated location Again Introduces a Static Asset 404 Risk

After creating the new go-dev reverse proxy virtual host, there was another issue that needed to be handled again, which I had already encountered during the launch the previous day.

The Nginx configuration auto-generated by OneinStack contains extra location rules.

For a normal website, these rules might not cause issues.

However, A Tour of Go’s static assets are served by the Go Tour service itself, for example:

/tour/static/css/app.css

If these are intercepted early by Nginx’s local static file rules, they will not proceed to:

proxy_pass http://127.0.0.1:3999

Ultimately, this could return:

404

Therefore, after the new virtual host was generated, I again deleted those two extra location blocks that would intercept the Tour’s static assets.

After modifying, I executed:

Bash
nginx -t && service nginx reload

This also confirmed an actual condition of the current server environment:

Bash
service nginx configtest

is unavailable on this server.

It will prompt:

Plaintext
service 命令只支持基础 LSB 动作

Therefore, the currently validated working method is:

Bash
nginx -t

Check the configuration, and after it passes:

Bash
service nginx reload

Or combine them directly:

Bash
nginx -t && service nginx reload

Then validate the static assets again:

https://go-dev.shuijingwanwq.com/tour/static/css/app.css

Returns:

200

https://go-dev.shuijingwanwq.com/tour/static/lib/codemirror/lib/codemirror.css

Similarly returns:

200

This indicates that /tour/static/ is again being passed to the Go Tour service via the main reverse proxy.


7. Officially Switch EdgeOne to the New go-dev Origin

After the new go-dev Nginx virtual host, HTTPS, and static assets were all validated as normal, I could end the initial temporary transition configuration.

The previous origin Host for the new domain in EdgeOne was:

go-tour.shuijingwanwq.com

This was officially changed to:

go-dev.shuijingwanwq.com

The final production link became:

go-dev.shuijingwanwq.com

→ EdgeOne

→ HTTPS origin pull 121.40.248.29:443

→ Host: go-dev.shuijingwanwq.com

→ New Nginx virtual host

→ 127.0.0.1:3999

→ go-tour.service

After completing this step, the new production domain completely no longer depended on the old go-tour Nginx virtual host.


8. Completely Delete the Old go-tour from the Server

Since:

  • The new go-dev page is normal;
  • HTTPS is normal;
  • Static assets are normal;
  • The Go example runs successfully;
  • EdgeOne officially pulls origin from go-dev;
  • The old domain 301 is handled at the EdgeOne edge;

There was no need for the server to keep the old:

go-tour.shuijingwanwq.com

Nginx virtual host.

I continued to use OneinStack’s built-in deletion process:

Bash
cd /root/oneinstack

./vhost.sh --del

Deleting only:

go-tour.shuijingwanwq.com

While the new:

go-dev.shuijingwanwq.com

remained untouched.

Then I continued to clean up:

  • The old Nginx virtual host;
  • The old Nginx backup configuration;
  • The old SSL files;
  • The old acme.sh certificate management records;
  • The /root/.acme.sh/go-tour.shuijingwanwq.com_ecc residual directory.

Ultimately, the only acme.sh record left related to this project was:

go-dev.shuijingwanwq.com

The certificate is still:

ec-256

CA:

LetsEncrypt.org

Figure 4: Origin server cleanup complete: Nginx and certificate management only retain the new go-dev production entry
Figure 4: Origin server cleanup complete: Nginx and certificate management only retain the new go-dev production entry

9. Why the Old go-tour Cannot Be Deleted from Cloudflare and EdgeOne Yet

The old go-tour has been completely deleted from the server, but the old domain in Cloudflare and EdgeOne cannot be deleted along with it.

This is because it now serves a new purpose:

The HTTPS compatibility entry point and permanent 301 for old URLs.

Therefore, Cloudflare still needs to keep:

go-tour.shuijingwanwq.com

the CNAME pointing to EdgeOne.

EdgeOne also continues to keep:

go-tour.shuijingwanwq.com

as well as the corresponding HTTPS certificate.

Otherwise, when users access:

https://go-tour.shuijingwanwq.com/…

they might fail to continue due to an HTTPS error before even receiving the 301.

Thus, the final architecture is not “completely delete the old domain,” but rather:

Plaintext
go-dev.shuijingwanwq.com
→ Official production site
→ EdgeOne
→ go-dev Nginx
→ Go Tour

go-tour.shuijingwanwq.com
→ EdgeOne
→ HTTPS
→ 301 to go-dev same path

Additionally, I changed the backup origin Host for the old go-tour in EdgeOne to:

go-dev.shuijingwanwq.com

Therefore, even in an extreme scenario where the 301 is not triggered and origin pull occurs, it will no longer depend on the deleted old Nginx virtual host.


10. Final Validation: 200, 200, 301

After the entire migration was complete, I compiled a very simple final validation.

New official page:

https://go-dev.shuijingwanwq.com/tour/welcome/1

Returns:

200

New domain static asset:

https://go-dev.shuijingwanwq.com/tour/static/css/app.css

Returns:

200

Old domain:

https://go-tour.shuijingwanwq.com/tour/welcome/1

Returns:

301

And:

Location: https://go-dev.shuijingwanwq.com/tour/welcome/1

Figure 3: Migration final validation: the new page and static assets both return 200, and the old domain correctly returns 301
Figure 3: Migration final validation: the new page and static assets both return 200, and the old domain correctly returns 301

At this point, this production domain migration can be officially deemed complete.


11. Adding a Production Maintenance Manual Along the Way

There was another notable takeaway during this migration process.

As the project goes on for longer, relying solely on historical chat logs to remember:

  • Which directory OneinStack currently uses;
  • How Nginx should be reloaded;
  • What method is used for HTTPS certificates;
  • How EdgeOne pulls origin;
  • Which internal names must not be renamed due to public domain changes;

is not reliable enough.

Therefore, after completing the domain migration, I added a new:

docs/PRODUCTION_RUNBOOK.md

to the project, specifically documenting the actual maintenance methods for the current production environment.

It and:

docs/PROJECT_STATE.md

serve different purposes.

PROJECT_STATE.md primarily records:

Where the project currently stands, and why it became the way it is now.

While PRODUCTION_RUNBOOK.md primarily records:

How the current production environment should be maintained.

It permanently records:

  • The Cloudflare and EdgeOne architecture;
  • The responsibilities of go-dev and go-tour;
  • go-tour.service and /data/go-tour/;
  • Nginx virtual host and certificate paths;
  • /root/oneinstack as the sole official maintenance directory;
  • The OneinStack priority principle;
  • nginx -t && service nginx reload;
  • /tour/static/ must not be intercepted by the local location;
  • Minimum production validation commands;
  • Precautions such as local proxies potentially interfering with curl --resolve direct origin connection checks.

When dealing with production server issues in the future, I can check this document first, rather than having to dig through a large volume of historical operations for details.


12. Why I Chose to Change the Domain Immediately After Just One Day Live

If this were a website that had been running for years, accumulating a large number of backlinks and search traffic, I would not change the production domain so easily.

But this situation was completely different.

go-tour.shuijingwanwq.com had just officially launched.

The cost of migrating at this point was very low, whereas continuing to use it meant accepting the redundant structure of:

go-tour.../tour/...

in the long term.

And the day before, I had already confirmed that directly deleting /tour/ would affect too much of the already stable program and validation logic.

So rather than modifying Tour itself to beautify the URL, it was better to just adjust the site entry point.

More importantly, the project might not always remain just A Tour of Go.

If Tour gains some traction later, I might selectively translate other content worth maintaining long-term within go.dev.

At that point:

go-dev.shuijingwanwq.com/tour/

can continue to host A Tour of Go.

In the future, if truly necessary, it could also naturally expand to something like:

go-dev.shuijingwanwq.com/doc/

or other content paths.

Therefore, this domain change was not just a URL beautification.

It was actually a minor adjustment to the project’s future content boundaries after completing the first phase of the official launch:

Keep the already stable /tour/, and place the broader semantics on the site-level domain.


13. Current Final State

As of the completion of this migration, the current production state of the A Tour of Go multilingual translation project is:

Official domain:

https://go-dev.shuijingwanwq.com

A Tour of Go:

https://go-dev.shuijingwanwq.com/tour

Old domain:

https://go-tour.shuijingwanwq.com

Responsibility:

Only retains HTTPS and same-path permanent 301.

Production service:

go-tour.service

Listening on:

127.0.0.1:3999

Production directory:

/data/go-tour/

Nginx official virtual host:

go-dev.shuijingwanwq.com

HTTPS:

Let’s Encrypt + ec-256

DNS:

Cloudflare

CDN:

Tencent Cloud EdgeOne

OneinStack official maintenance directory:

/root/oneinstack

Final HTTP validation:

  • New course page: 200;
  • New static asset: 200;
  • Old domain: 301;
  • Original path: fully preserved;
  • Chinese page: normal;
  • Go example remote execution: normal.

From this moment on, go-dev.shuijingwanwq.com became the project’s new official production entry point.

And go-tour.shuijingwanwq.com officially stepped back into the role of a compatibility redirect entry point.

Next, I plan to add a clearer “unofficial community multilingual translation project” notice to the entire site, and further organize the project introduction and brand boundaries. However, this content will not be mixed into this domain migration; it will be handled separately in the next phase.

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系