> For the complete documentation index, see [llms.txt](https://germ.gitbook.io/pupcloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://germ.gitbook.io/pupcloud/guides/reverse-proxy.md).

# Reverse Proxy

Running a reverse proxy in front of pupcloud is almost mandatory if you want to expose it on the internet. More than that, there are a number of reverse proxies that allow you to protect a http connection with https, using a free certificate provided for example by [Let's Encrypt](https://letsencrypt.org) or similar.

{% hint style="warning" %}
For authentication, a custom HTTP header is used, `x-pupcloud-pwd`. Be sure that the reverse proxy passes it untouched.
{% endhint %}

We'll show here how to integrate with two popular solutions, [Caddy](https://caddyserver.com) and [NGINX](https://www.nginx.com).

#### Caddy

To access pupcloud from (e.g.) `https://pupcloud.test.com`:

1. Expose ports 80 and 443 of the server to which the DNS points;
2. Run pupcloud. Leave the port as 17178;
3. Launch caddy:\
   `sudo caddy reverse-proxy --from pupcloud.test.com --to localhost:17178`

{% hint style="danger" %}
You'll need to launch caddy with root/admin privileges, as it must access privileged ports.
{% endhint %}

#### NGINX

NGINX is quite complex to configure, and it's beyond the scope of this document. Usually, we make use of [LinuxServer's Swag](https://docs.linuxserver.io/general/swag) Docker image, paired with pupcloud's own docker image. The relevant config is in `nginx/site-confs/default`:

```nginx
server {
        listen 443 ssl http2;
        server_name pupcloud.test.com;
        include /config/nginx/proxy-confs/*.subfolder.conf;
        include /config/nginx/ssl.conf;
        location / {
                proxy_pass http://localhost:17178/;
        }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://germ.gitbook.io/pupcloud/guides/reverse-proxy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
