October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk8 min

How to Fix Ghost Redirecting to Localhost:2368

Ghost redirects to localhost:2368 when its canonical URL or proxy information is wrong. Set the public URL, restart Ghost, preserve Host and X-Forwarded-Proto, and verify with headers.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a production Ghost site sends visitors to localhost:2368, Ghost is advertising its development address instead of the address users should open. Set Ghost’s canonical url to the complete public HTTPS (or HTTP) address, restart Ghost, and leave port 2368 as the private upstream used by your reverse proxy. If the redirect remains, check that the proxy preserves the public Host and protocol, especially X-Forwarded-Proto: https after TLS termination.

What the localhost redirect means

Ghost has two different addresses in a typical deployment:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Public URL: the scheme and hostname readers use, such as https://example.com.
  • Internal listener: the process address, commonly 127.0.0.1:2368, which a local reverse proxy can reach.

Those values are not interchangeable. Ghost’s production configuration requires url to be the public URL for the blog. Port 2368 may remain the internal service port; it should not appear in links or redirects sent to visitors unless you deliberately expose that port.

A localhost redirect usually has one of three causes:

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
  • The active production configuration still contains a development value such as http://localhost:2368.
  • A reverse proxy is forwarding the wrong host or protocol, so Ghost reconstructs an internal address or believes an HTTPS request is HTTP.
  • You are running Ghost in development or through a tunnel, where localhost links are expected until a forwarding URL is configured.

Fix the canonical URL first, then validate the proxy. Changing a browser bookmark or adding a port mapping does not change Ghost’s canonical address.

Find the public URL Ghost should use

Decide exactly what a reader should type before editing anything. Include the scheme and hostname, and include a nonstandard public port only when readers genuinely connect through that port.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use https://example.com when TLS is terminated at your proxy or load balancer.
  • Use http://example.com only when the site is intentionally served without TLS.
  • Do not use http://localhost:2368, http://127.0.0.1:2368, a Docker service name, or an internal hostname as the production value.
  • Use one canonical hostname. If both a bare domain and a www name are available, choose the one your front-end configuration designates as primary and redirect the other at the proxy.

The value must describe the externally reachable address, not the socket on which the Node process listens. If a load balancer accepts HTTPS and forwards plain HTTP to Ghost, the public value is still the HTTPS address.

Fix a Ghost CLI or manual installation

Use Ghost CLI when it manages the installation

From the Ghost installation directory, set the URL and restart the service:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
  1. Open a shell on the server and change to the directory managed by Ghost CLI.
  2. Run ghost config url https://example.com, replacing the example with the exact public address.
  3. Run ghost restart so the running process reloads its configuration.
  4. Test the public hostname rather than the internal port.
ghost config url https://example.com
ghost restart

The command changes the configuration Ghost CLI uses for the environment in which it is run. If you have separate staging and production installations, run it in the correct installation directory and verify which process is serving the public hostname.

Edit the production configuration manually

For a manual installation, put the equivalent value in the active production configuration file, commonly a file named config.production.json. The exact path depends on how Ghost was installed, so identify the file actually used by the service rather than creating a second file that Ghost never reads.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "url": "https://example.com"
}

Preserve the rest of the existing JSON settings and valid comma placement. After saving, restart the service using the process manager that starts Ghost. A configuration file change has no effect on an already-running process until it is restarted.

Confirm you changed the active environment

It is common to edit a development file while the public service reads production settings, or to update one server while DNS points to another. Check the following before deeper proxy debugging:

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
  • The process serving the domain is the process you restarted.
  • The file belongs to the production environment, not a local development environment.
  • The public DNS record resolves to the server or load balancer you changed.
  • No deployment system regenerates the configuration with an old URL at startup.

Configure nginx without changing Ghost’s internal port

The usual arrangement is nginx on the public interface and Ghost listening privately on 127.0.0.1:2368. nginx should pass the original host and the client-facing protocol to Ghost.

location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:2368;
}

What each proxy setting does

  • proxy_pass http://127.0.0.1:2368 selects the private Ghost upstream. It does not make 127.0.0.1:2368 the public URL.
  • Host $http_host preserves the hostname and, where present, the request port from the client-facing request.
  • X-Forwarded-Proto $scheme tells Ghost whether nginx received HTTP or HTTPS.
  • X-Forwarded-For carries the client address through the proxy chain.
  • X-Real-IP supplies the direct client address to applications that use that header.

After changing an nginx site, validate the configuration with your normal nginx syntax-check command, reload nginx, and restart Ghost if its own url was also changed. Keep the private listener bound to loopback unless you have a specific reason to expose it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When another load balancer terminates TLS

Sometimes a CDN, load balancer, or edge proxy accepts HTTPS and sends HTTP to nginx. In that design, $scheme at nginx may be http even though the visitor used HTTPS. The final request reaching Ghost must still communicate the public HTTPS scheme. Otherwise Ghost can think the request is insecure, redirect to HTTPS, and create an infinite redirect loop.

Ensure that your proxy chain has a single, trusted rule for setting X-Forwarded-Proto and that the value reaching Ghost is https for an HTTPS visitor. Do not blindly append conflicting values from untrusted clients; configure the edge component and nginx according to your network topology.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Docker deployments: separate the URL from port publishing

In Docker, set Ghost’s url environment variable to the public address:

url=https://example.com

The container may continue listening on port 2368, and your proxy may reach it by a container network name. A host mapping such as 8080:2368 only maps a host port to the container port; it does not tell Ghost which hostname or scheme to place in canonical links and redirects.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apply the change safely

  1. Update the environment file, Compose definition, or deployment secret that supplies url.
  2. Recreate or restart the container so the new environment is loaded.
  3. Confirm that the proxy’s upstream points to the current container and that it forwards Host and X-Forwarded-Proto.
  4. Request the public hostname and inspect the Location header if a redirect occurs.

Do not set url to an internal service name such as ghost, a container IP, or localhost. Those names may work between containers but are not addresses a browser can use.

Stop HTTPS redirect loops

A loop commonly looks like this: the browser requests https://example.com, the edge proxy forwards HTTP internally, Ghost does not receive reliable protocol information, and Ghost redirects back to HTTPS. The browser repeats the request indefinitely.

  1. Set Ghost’s production url to the HTTPS public address.
  2. Identify which component terminates TLS.
  3. At that component, establish the authoritative external scheme.
  4. Pass X-Forwarded-Proto: https through the remaining proxy chain for an HTTPS request.
  5. Preserve the public Host header.
  6. Restart or reload each component whose configuration changed.

If TLS terminates directly in nginx, proxy_set_header X-Forwarded-Proto $scheme; sends https on the HTTPS server block. If TLS terminates earlier, make sure nginx does not overwrite an already-correct external value with its internal HTTP scheme.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Development servers and tunnel URLs

Localhost is not always an error. Ghost’s development environment normally uses http://localhost:2368. Links can continue to use that address until you place a tunnel or forwarding URL in the local configuration and restart the development environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the right expectation for each case

Scenario Expected URL setting What to do
Local development on one computer http://localhost:2368 may be intentional Leave it unless another device or tunnel must access the site.
Temporary tunnel The tunnel’s current public forwarding URL Set that URL in local configuration and restart; update it when the tunnel address changes.
Production behind a proxy Your stable public domain, normally HTTPS Set the production url and preserve host and protocol headers.
Container behind a proxy The external domain, not the service name Set the environment variable and recreate or restart the container.

A tunnel URL that changes between sessions cannot serve as a permanent production canonical URL. For production, use a stable domain and certificate arrangement.

Verify the fix without trusting a cached redirect

Browsers cache permanent redirects aggressively. Test the current server response independently before concluding that Ghost is still misconfigured.

  1. Open a private browsing window and visit the public hostname.
  2. From a shell, request headers from the public address with curl -I https://example.com.
  3. Inspect any Location header. It should use the configured public scheme and hostname, not localhost or an internal address.
  4. If the response is a redirect from HTTP to HTTPS, follow the chain and confirm it ends at the canonical HTTPS URL rather than repeating.
  5. Test the public hostname from outside the server. A request made on the server itself can take a different proxy path than a real visitor.

Private-window browsing and curl -I are verification techniques, not substitutes for correcting the running configuration. If the header still names localhost, identify which layer generated it: Ghost’s url, a proxy rewrite, an old container, or a different server selected by DNS.

Read the symptom to find the failing layer

Symptom Likely cause Next check
Every link points to localhost:2368 Production url still contains the development address, or the wrong environment was edited. Inspect the active production configuration and restart the serving process.
Homepage opens, but admin or asset URLs use localhost Ghost is still generating canonical URLs from an incorrect url. Correct url; do not rely on a proxy-only hostname rewrite.
Browser alternates between HTTP and HTTPS Ghost is not receiving the public protocol after TLS termination. Trace X-Forwarded-Proto through every proxy and ensure HTTPS reaches Ghost as https.
Redirect works on the server but not externally DNS, an edge proxy, or a second backend is serving the public request. Check DNS destination and which instance receives the external request.
Docker restart appears ineffective The container was not recreated with the changed environment, or another container is serving traffic. Verify the running container’s environment and proxy upstream.
Only an old browser shows localhost A cached permanent redirect or cached page remains. Use private browsing and curl -I before clearing site data.

Choose the correction based on your deployment

Deployment Public URL location TLS terminator Restart after change Header requirement
Ghost CLI installation ghost config url or the managed production configuration Usually nginx or another front proxy ghost restart Preserve Host and X-Forwarded-Proto
Manual installation Active production configuration file Your configured web server or load balancer The service manager that runs Ghost Preserve public host and protocol
Docker url environment variable Host proxy or external edge Restart or recreate the container Do not substitute an internal service name
Development or tunnel Local configuration or current forwarding URL Tunnel provider or local proxy Restart the development environment Forwarding URL must be configured if links need to be public

Final checklist

  • The production url exactly matches the public scheme and hostname.
  • localhost, 127.0.0.1, and port 2368 are used only as internal or development addresses.
  • The process or container serving production was restarted after the change.
  • The reverse proxy forwards the public Host.
  • Ghost receives the correct X-Forwarded-Proto, especially https after upstream TLS termination.
  • Docker port publishing is not being mistaken for canonical URL configuration.
  • Private-window and header tests show the current response rather than a cached redirect.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.