# Reverse Proxy

**URL:** <https://discourse.gohugo.io/t/reverse-proxy/35086>\
**Category:** support\
**Created:** [October 10, 2021, 6:29pm UTC](https://discourse.gohugo.io/t/reverse-proxy/35086 "2021-10-10T18:29:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justman10000](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/justman10000/32/15235_2.png) [@Justman10000](https://discourse.gohugo.io/u/Justman10000)\
**Post date:** [October 10, 2021, 6:29pm UTC](https://discourse.gohugo.io/t/reverse-proxy/35086/1 "2021-10-10T18:29:25Z")

</div>

Hi, I want to use Hugo via a reverse proxy… As far as the config:

```auto
<VirtualHost *:80>

    ServerName <mydomain>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    RewriteEngine on

    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

</VirtualHost>

<VirtualHost *:443>

    ServerName <mydomain>

    SSLEngine On

    SSLCertificateFile /etc/letsencrypt/archive/<mydomain>/cert.pem

    SSLCertificateKeyFile /etc/letsencrypt/archive/<mydomain>/privkey.pem

    SSLCertificateChainFile /etc/letsencrypt/archive/<mydomain>/fullchain.pem

    ProxyPass / http://127.0.0.1:5000/

    ProxyPassReverse / http://127.0.0.1:5000/

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

```

  
Runs so far, but always comes:

 ![grafik](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/1/1101d83310d8c15ea142e15b529672d4f7ab64c8.png)

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [October 11, 2021, 5:08am UTC](https://discourse.gohugo.io/t/reverse-proxy/35086/2 "2021-10-11T05:08:27Z")

</div>

If you’re committed to doing the sysadmin stuff for a webserver like apache (as opposed to using netlify, vercel etc), then why use `hugo server` at all? Just push your `hugo`-generated `public` folder content to a vhost folder. Fewer moving parts, for sure?

You’re listening on 5000, so, did you specify that port when running `hugo server`?

By the way there are plenty of posts in here about “reverse proxy”.

---

<div class="post-metadata">

**Author:** ![Justman10000](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/justman10000/32/15235_2.png) [@Justman10000](https://discourse.gohugo.io/u/Justman10000)\
**Post date:** [October 13, 2021, 5:01pm UTC](https://discourse.gohugo.io/t/reverse-proxy/35086/4 "2021-10-13T17:01:51Z")

</div>

> If you’re committed to doing the sysadmin stuff for a webserver like apache (as opposed to using netlify, vercel etc), then why use hugo server at all? Just push your hugo-generated public folder content to a vhost folder. Fewer moving parts, for sure?

Is correct! LUL! I didn’t even know 🤣!

> You’re listening on 5000, so, did you specify that port when running hugo server?

Yes
