# Production Site Hosting

## Running a Production Server

{% hint style="warning" %}
go-live does not support HTTPS yet, but it is on the roadmap! We recommend Cloudflare for now to handle SSL.
{% endhint %}

Serving a site in production is trivial with go-live. This process is very efficient and can be used with small and inexpensive compute instances. An example of serving a production site is:

```
go-live --dir production-site/ --port 80 --quiet
```

![Running two servers side by side with Tmux. Note the different ports.](https://4192112914-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIG-9ChqjpW2S2ZlhRl%2F-MPqd9UnTfEWAGtH1J9v%2F-MPqeDFXPFECksXmYkdL%2FScreen%20Shot%202020-12-30%20at%2018.37.49.png?alt=media\&token=30e479e7-6b03-47aa-b724-6446eb066d04)

### Recommended: Start the Process in tmux

To start a persistent session with tmux. Tmux means when you close your SSH session your server won't shut down. Learn about tmux: <https://www.hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/>

```
$ tmux
$ go-live --dir production-site/ --port 80 --quiet
```

### Recommended: Using with a Frontend (nginx)

You can start nginx on the same host as go-live and use it to proxy connections.  Here is an example nginx.conf (located in /etc/nginx/nginx.conf) for example.com on Port 9000.  The go-live process runs on Port 9000, and users connect through nginx on Port 80.&#x20;

```
events {
  worker_connections  4096;  ## Default: 1024
}

http {
server {

    listen 80;
    listen [::]:80;
    server_name example.com;

    location ^~ /{
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass    http://127.0.0.1:9000/;
    }
}
}
```

### Recommended: Using with a CDN (Cloudflare)

Cloudflare can provide caching and DDOS protection for your go-live server. We recommend setting up Cloudflare as the DNS provider and then proxying requests to your go-live server IP address on Port 80.\
\
Cloudflare can also provide HTTPS support for users who connect through it.
