> ## Content Index
> Fetch the complete content index at: https://sudormrf.run/llms.txt
> Use this file to discover other available public pages before exploring further.

# 도메인 구입, 개인 웹서버 Ghost에 연결하기
- URL: https://sudormrf.run/2016/02/10/domain-webserver-connect/
- Published: 2016-02-10T12:40:09.000Z
- Updated: 2022-09-18T06:48:42.000Z
- Author: Junho Cho
- Tags: ghost, #Import 2026-10-24 03:36

개인 웹서버에 Ghost가 설치되어 있다고 가정하고 시작한다.[\[1\]](#fn1) 일단 개인 웹서버의 ip주소가 123.123.123.123 뭐 이렇게 되어있다고치면 80포트가 열려있어야한다. 웹에서 [http://123.123.123.123](http://123.123.123.123/?ref=sudormrf.run) 로 접속하면 사실은 [http://123.123.123.123:80](http://123.123.123.123/?ref=sudormrf.run) 으로 접속한다. 근데 만약에 내 개인 웹서버에 여러 블로그나 다른 웹서버를 운영하고 싶다면? 80포트가 하나밖에 없어도 nginx로 proxy\_pass를 설정함으로 접속한 도메인에 따라 다른 웹서버로 접속하도록 가능하다. nginx 설치가 되어있어야한다.

총 두군데서 도메인을 구입해봤다. <Hosting.kr>, [가비아](domain.gabia.com)  
개인적으로 가비아가 더 관리는 편한듯 한데, 가격은 Hosting.kr이 더 싼 것 같다.  
그 외에 [Amazon R53](https://aws.amazon.com/ko/route53/?ref=sudormrf.run)이 있는데 .com 도메이 12$로 제일 쌌는데 지금은 Hosting.kr이 부가세 포함 10,780원으로 제일 싸다.

### 도메인 연결

가비아는 `부가서비스>네임플러스`에서 이렇게 IP주소를 채워넣으면 되고  
![](https://sudormrf.run/content/images/2016/02/---.png)

Hosting.kr은 알아내는데 고생을 많이 했는데 포워딩 이런거 다안되고  
![](https://sudormrf.run/content/images/2016/02/hostingkr.png)  
`부가서비스>네임서버 설정 관리`에서 아래 항목에서 서브도메인을 빈칸으로 두면 내가 산 도메인으로 summerlyjinx.com 일 것이고 blog,www 등을 써넣으면 www.summerlyjinx.com 으로 접속이 가능할 것이다. 그리고 IP주소를 채워넣으면 된다.

### Nginx에서 접속해온 도메인 받고 고스트로 연결시키기

고스트 블로그가 두개가 돌고 있다고 가정하자. 그럼 웹서버의 [http://127.0.0.1:2368](http://127.0.0.1:2368/?ref=sudormrf.run), [http://127.0.0.1:2369](http://127.0.0.1:2369/?ref=sudormrf.run) 두 개의 블로그가 있을 것이다. 그리고 각 블로그는 [\[1:1\]](#fn1)에 이미 설명된 과정이지만 다시 설명하자면 nginx에 의해서 다음처럼 연결이 되어있다.

> Nginx 설치 후 Ghost가 이미 2368에 있는 걸 알려 줘야함.  
> 새로운 Nginx 설정 파일은  
> (CentOS) :`/etc/nginx/conf.d/`  
> (Ubuntu) :`/etc/nginx/sites-enabled`  
> 설정 파일 이름은 `your-domain-name.conf` 처럼 짓는 게 좋다.  
> 그리고 아래 에서 `your-domain-name.com`는 우리 도메인으로 바꾸자.  
> `your-domain-name.conf` 에서 다음을 추가/수정해주자.

```
server {
    listen 80;
    server_name your-domain-name.com;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:2368;
    }
}

```

결국 이부분에서 `your-domain-name.conf`을 여러개 만들고 각각에서 `proxy_pass http://127.0.0.1:2368`을 맞는 Ghost가 돌아가는 포트로 바꿔주면 된다.  
예를 들어, 각 `.conf`을 다음처럼 바꾼다.

```
server {
    listen 80;
    server_name blog.summerlyjinx.com www.summerlyjinx.com summerlyjinx.com;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:2369;
    }
}

```

그리고 admin 계정으로 들어가기 위해 물론 ghost>config.js에서 production 모드에서 url설정을 해줘야한다.

```
config = {
    // ### Production
    // When running Ghost in the wild, use the production environment.
    // Configure your URL and mail settings here
    production: {
        url: 'http://blog.summerlyjinx.com',
        mail: {},
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost.db')
            },
            debug: false
        },

        server: {
            host: '127.0.0.1',
            port: '2369'
        }
    },

```

---

1. **GHOST\_URL**/blogging-platform-ghost-start/ [↩︎](#fnref1) [↩︎](#fnref1:1)