# \[solved\] Links pointing to localhost instead base\_url

**URL:** <https://zola.discourse.group/t/solved-links-pointing-to-localhost-instead-base-url/2084>\
**Category:** Support\
**Created:** [March 16, 2024, 3:57pm UTC](https://zola.discourse.group/t/solved-links-pointing-to-localhost-instead-base-url/2084 "2024-03-16T15:57:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zola](https://avatars.discourse-cdn.com/v4/letter/z/aeb1de/32.png) [@zola](https://zola.discourse.group/u/zola)\
**Post date:** [March 16, 2024, 3:57pm UTC](https://zola.discourse.group/t/solved-links-pointing-to-localhost-instead-base-url/2084/1 "2024-03-16T15:57:53Z")

</div>

Hi,

I have problems getting Zola to wok on my setup. On my public server I have two VMs. One VM is running nginx as a reverse proxy, the other VM is running Zola. When running `zola serve -i 0.0.0.0` the website is accessable under `https://some-url.com` but all links are pointing to `127.0.0.1`, i.e. `127.0.0.1/archive`. The theme I used on this installation is also not applied, I just get a plain site with text. But I guess this is related to the “localhost-problem”.  
When I start Zola with `zola serve -i 0.0.0.0 -u some-url.com` the website won’t load at all.

What I’m doing wrong?

Here is my config.toml:

```auto
# Be sure to change these!
base_url = "https://some-url.com"

menu_items = [
    # each of these is optional, name and url are required
    # $BASE_URL is going to be substituted by base_url from configuration
    {name = "blog", url = "$BASE_URL"},

    # tags should only be enabled if you have "tags" taxonomy
    # see documentation below for more details
    {name = "tags", url = "$BASE_URL/tags"},
    {name = "archive", url = "$BASE_URL/archive"},
]

```

And here is the config of my reverse proxy:

```auto
server {
    listen 80;
    listen [::]:80;
    server_name some-url.com;

    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    location / {
        proxy_pass http://some-url.com:1111;
    }

    server_name some-url.com;
    ssl_certificate /etc/letsencrypt/live/some-url.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/some-url.com/privkey.pem;
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
    ssl_session_tickets off;

    # curl https://ssl-config.mozilla.org/ffdhe2048.txt > /path/to/dhparam
# ssl_dhparam /path/to/dhparam;

    # intermediate configuration
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
    ssl_prefer_server_ciphers off;

    # HSTS (ngx_http_headers_module is required) (63072000 seconds)
    add_header Strict-Transport-Security "max-age=63072000" always;
}

```

---

<div class="post-metadata">

**Author:** ![zola](https://avatars.discourse-cdn.com/v4/letter/z/aeb1de/32.png) [@zola](https://zola.discourse.group/u/zola)\
**Post date:** [March 16, 2024, 6:13pm UTC](https://zola.discourse.group/t/solved-links-pointing-to-localhost-instead-base-url/2084/2 "2024-03-16T18:13:30Z")

</div>

Okay, after some more research I have now found out that ‘zola serve’ is actually only for testing and I have to use ‘zola build’ to build the website.

---

<div class="post-metadata">

**Author:** ![adrianboston](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/adrianboston/32/907_2.png) [@adrianboston](https://zola.discourse.group/u/adrianboston)\
**Post date:** [March 18, 2024, 12:52am UTC](https://zola.discourse.group/t/solved-links-pointing-to-localhost-instead-base-url/2084/3 "2024-03-18T00:52:46Z")

</div>

I have two config files, one for `dev` and one for `production/release`

config

```auto
# The URL the site will be built for
base_url = "http://127.0.0.1:1111"

```

config.production

```auto
# The URL the site will be built for
base_url = "https://mydomain.com"

```

Then use a makefile with the following

```auto

ZOLA = /opt/local/bin/zola
CONFIG_DEV = config.toml
CONFIG_PROD = config-production.toml

build:
	$(ZOLA) build

build-prod:
	$(ZOLA) --config $(CONFIG_PROD) build

```

Then finally push (rsync in this case) to a remote machine.

```auto
rsync:
	$(RSYNC) -av -e "ssh -i \"$(SSH_CERT_PATH)\"" $(OUTPUT_PATH) $(USER)@$(HOST):$(DEST_PATH)

```
