# Trying to access local dev server with a public IP causes all sorts of problems

**URL:** <https://discourse.gohugo.io/t/trying-to-access-local-dev-server-with-a-public-ip-causes-all-sorts-of-problems/50160>\
**Category:** support\
**Created:** [June 5, 2024, 6:18am UTC](https://discourse.gohugo.io/t/trying-to-access-local-dev-server-with-a-public-ip-causes-all-sorts-of-problems/50160 "2024-06-05T06:18:05Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)\
**Post date:** [June 5, 2024, 1:08pm UTC](https://discourse.gohugo.io/t/trying-to-access-local-dev-server-with-a-public-ip-causes-all-sorts-of-problems/50160/14 "2024-06-05T13:08:09Z")

</div>

> [@vipulvpatil](#):
>
> Outside of Hugo, I have setup `https://code.1313.airetreat.co/` to point to `localhost:1313` on this instance.

So, you’re on host A and ssh into host B. On host B, you run `hugo server`. Also on host B, you “set up” [https://code.1313.airetreat.co](https://code.1313.airetreat.co) to “point to” localhost:1313.

If that’s the case (and I’m still not sure it is, as you use unfamiliar terms like “outside of Hugo” and “point host C to host B”):

- start hugo server with the correct `baseurl`, which would be `https://code.1313.airetreat.co`, possibly with the added directory as pointed out by @irkode .
- also, provide a `bind` option to the `hugo server` command, pointing to the public IP address of host B.

> [@Using Hugo server command to make a site accessible on your local network with options --bind and --baseUrl](https://discourse.gohugo.io/t/using-hugo-server-command-to-make-a-site-accessible-on-your-local-network-with-options-bind-and-baseurl/35814):
>
> What a brilliant feature and I only discovered this the other day so thought I’d post it here in case it helps others to see a real example. If you want to test your site on other devices on your local network you can use the following: hugo server -D --bind 192.168.X.Y --baseUrl http://192.168.X.Y Replace the X & Y with the actual numbers of your host machine’s IP and when your site builds it will be available to your local network on 192.168.X.Y:1313 rather than the usual localhost:1313 whi…

Finally: Accessing a HTTP host via HTTPS is a bit uncommon. And your setup is, in my opinion, overly complicated. If host B has a public IP anyway, why all this “pointing to” stuff? Why not use ssh forwarding ([https://www.otorio.com/blog/back-to-basics-guide-to-ssh-tunneling/](https://www.otorio.com/blog/back-to-basics-guide-to-ssh-tunneling/)) if you’re ssh’ing to host B anyway?

---

_[View the full topic](https://discourse.gohugo.io/t/trying-to-access-local-dev-server-with-a-public-ip-causes-all-sorts-of-problems/50160)._
